Rewrite log file for test environment