Now that I've removed my ExceptionMapper for Throwable, logging has returned however I've lost my custom error response with useful diagnostic information.
I realize I could incorporate logging into the ExceptionMapper, or in a 'catch' block within the request handlers in the Resource class, however neither seem ideal.
Anyone care to recommend an approach for maintaining the logging on unhandled exceptions by the server / container and also having a customized error response via ExceptionMapper?
Thanks.
Jeremy
From: Jeremy Johnson [mailto:jeremy.johnson_at_imtc.gatech.edu]
Sent: Tuesday, June 05, 2012 10:20 AM
To: users_at_jersey.java.net
Subject: [Jersey] Re: Logging unhandled exceptions?
Hi Pavel,
Thanks for the insight! You were right about the glitch preventing the container from logging the exceptions. In my case, I had an ExceptionMapper mapping Throwable. Once removed, unhandled exceptions are logged as expected.
Thanks,
Jeremy
From: Pavel Bucek [mailto:pavel.bucek_at_oracle.com]<mailto:[mailto:pavel.bucek_at_oracle.com]>
Sent: Tuesday, June 05, 2012 1:58 AM
To: users_at_jersey.java.net<mailto:users_at_jersey.java.net>
Subject: [Jersey] Re: Logging unhandled exceptions?
Hello Jeremy,
unhandled exceptions should be present in server/container log, but there might be some glitch where the issue is swallowed without proper notice. Have you encountered such situation? Or do you want something different (maybe more suitable for your needs?)
Regards,
Pavel
On 6/4/12 11:05 PM, Jeremy Johnson wrote:
Sorry, I realize I could have been a little more specific. I'd like log the traces of any unhandled exceptions raised by my Jersey resource classes. What's the recommended approach to implement this?
Thanks!
Jeremy
From: Jeremy Johnson
Sent: Monday, June 04, 2012 4:43 PM
To: users_at_jersey.java.net<mailto:users_at_jersey.java.net>
Subject: Logging unhandled exceptions?
I notice that Jersey doesn't seem to log internal errors generated from unhandled exceptions raised in the resource classes. What's the recommended approach to introduce such logging?
Thanks!
Jeremy