Always flush after writing to log files
Fix truncating log files