Better way to close log_file