Close the log file after execution.