fix slow log file output