error handling: redirect errors to a logger file