Log4j Accelerator.

Setup

Log4j Accelerator is easy to set up. After adding the library to your project, create or modify the log4j2.components.properties file in the root of your project's resources directory. If using the default Gradle or Maven layout, this will be your_project/src/main/resources/log4j2.components.properties.

In this file, set the log4j2.contextSelector property: log4j2.contextSelector=com.log4jaccelerator.core.AcceleratedContextSelector. If you already have this property set, contact Support.

That's it! Your application is set to have its logging accelerated!

Additional options

Log4j Accelerator comes with several optional runtime modes to best suit your application.

ClassLoaderContext

If your application runs in a multi-application environment, such as a Tomcat or OpenLiberty, and gets unloaded, you'll want to use the AcceleratedClassLoaderContextSelector. To do so, set the log4j2.contextSelector property as log4j2.contextSelector=com.log4jaccelerator.core.AcceleratedClassLoaderContextSelector. If your application doesn't get unloaded, prefer the regular AcceleratedContextSelector for its superior performance.

Changing log levels

By default, a Logger whose level cannot be changed is used. If your application requires changing the level of a Logger at runtime, you can set the com.log4jaccelerator.core.Logger System Property to ReconfigurableAcceleratedLogger. This will reduce the performance of Log4j Accelerator, but you'll still see improvements compared to running the application without Log4j Accelerator.