clear messagesToLog