also put error logs in a log file