How should I log uncaught exceptions in my RESTful JAX-RS web service?
For lack of a better way to implement logging for uncaught JAX-RS exceptions, using a catch-all ExceptionMapper as in Other Ideas: #1 seems to be the cleanest, simplest way to add this functionality. Here’s my implementation: @Provider public class ThrowableExceptionMapper implements ExceptionMapper<Throwable> { private static final Logger log = Logger.getLogger(ThrowableExceptionMapper.class); @Context HttpServletRequest request; @Override public … Read more