How to enable AsynLoggers in log4j2

There are two steps

1. Set below in jvm arguments

-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector 

2. Create log4j2.component.properties file with the below content

Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector

If the deployed application is ear then place log4j2.component.properties inside ear directly and if the deployed application is war then place the log4j2.component.properties file in WEB-INF folder



Comments

Popular Posts