Asynchronous or not?

Due to modern requirements in terms of scaling, the loggers needed to be enhanced to support a higher message rate, but still needed to be less impactful on the application performance itself.

The first step to reduce the latency of a logger is to make the handlers asynchronous. This is not yet standard with JUL but you can find some libraries providing that feature—some containers like Apache TomEE even provide it out of the box. The idea is exactly the one we described in the section about handlers, compute the minimum context for the log record and push the record in a queue in the caller thread, then actually store/publish the message in another thread (or threads depending on the backend).

This pattern already solves ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.