Redirect error messages to logfile