Redirect output to a log file.