Add logging to error output