logs errors to .log