logging error output to file