Record all errors to a log file.