Asynchronous Logging
Log4j2 Supports Async loggers. These loggers provide a drastic improvement in performance compared to their synchronous counterparts.
Async Loggers internally use a library called Disruptor for asynchronous logging.
We need to include Disruptor dependency for using async loggers. Add the following to your pom.xml
file –
<!-- Needed for Async Logging with Log4j 2 -->
<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
<version>3.3.6</version>
</dependency>