I appear to be having an issue with logging uncaught exceptions and I was hoping that someone might be able to point me in the right direction. When my Resource method throws an unexpected and uncaught exception I'm failing to see those exceptions in my logging system. In my particular case, these errors are not showing in Sentry.io. I've been debugging this for a bit and I believe it might be due to an implementation bug in Jersey2.
I'm setting up the LoggingFeature in my ResourceConfig like so:
With that setting all Jersey request and response data is of course logged at the WARNING level. However, even with setting the LoggingFeature level to WARNING, the uncaught exception is logged with a level of DEBUG. That appears to be coming from org.glassfish.jersey.server.ServerRuntime.process() line 506 in version 2.25:
Does anyone know why we are logging all uncaught exception at the DEBUG level instead of at the proper ERROR or WARNING level? Am I missing something? Is there a reason that the JerseyProcessingUncaughtExceptionHandler is not being invoked?