How do i set the number of threads for Async Logger and Async Appender in log4j2? Is it using one thread by default?
I tried running for a batch of 100,000 records, i dont see any difference in the last log statement time and end timestamp of application exit displayed using system.out.print. How can i prove that this is logging asynchronous?
<RollingFile name="APP.ALERT" fileName="C:\Users\sbasheer\Downloads\abc\Alert.log"
filePattern="C:\Users\sbasheer\Downloads\abc\Alert%d{MM-dd-yyyy}-%i.log" immediateFlush="true" append="true">
<PatternLayout>
<Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="25 MB"/>
</Policies>
<DefaultRolloverStrategy max="50"/>
</RollingFile>
<AsyncLogger name="com.abc.asyncsample" level="trace" includeLocation="true" additivity="true">
<AppenderRef ref="APP.ALERT" level="error" />
</AsyncLogger>