Flush log messages after written