Open the log file once.