Logging error on uncaught exceptions