Add log file write flush