log error to file