Quantcast

Logging unhandled exceptions?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Logging unhandled exceptions?

Jeremy Johnson

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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Logging unhandled exceptions?

Jeremy Johnson

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: [hidden email]
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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Logging unhandled exceptions?

Pavel Bucek-2
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: [hidden email]
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Logging unhandled exceptions?

Jeremy Johnson

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:[hidden email]]
Sent: Tuesday, June 05, 2012 1:58 AM
To: [hidden email]
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: [hidden email]
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

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Logging unhandled exceptions?

Jeremy Johnson

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:[hidden email]]
Sent: Tuesday, June 05, 2012 10:20 AM
To: [hidden email]
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 [hidden email]
Sent: Tuesday, June 05, 2012 1:58 AM
To: [hidden email]
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: [hidden email]
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

 

Loading...