print errors to logfile