log errors to file