error writes to log file