Moving error logging to log file.