[
https://issues.apache.org/jira/browse/LOG4J2-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Laurent Hasson updated LOG4J2-2135:
-----------------------------------
Environment:
* java 1.8.151
* log4j-api-2.9.1.jar
* log4j-core-2.9.1.jar
* log4j-web-2.9.1.jar
* disruptor-3.3.6.jar
was:
*+Libraries+*:
* java 1.8.151
* log4j-api-2.9.1.jar
* log4j-core-2.9.1.jar
* log4j-web-2.9.1.jar
* disruptor-3.3.6.jar
*+Configuration file+*:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info">
<Appenders>
<Console name="Console" target="SYSTEM_OUT" >
<PatternLayout>
<pattern>%d{MMdd.HHmmss.SSS}#%-3t
%level{length=1} %15.15c{1}| %m%ex{20}%n</pattern>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<AsyncRoot level="debug">
<AppenderRef ref="Console" />
</AsyncRoot>
</Loggers>
</Configuration>
> Logs are not flushed when using AsyncRoot
> -----------------------------------------
>
> Key: LOG4J2-2135
> URL: https://issues.apache.org/jira/browse/LOG4J2-2135
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.9.1
> Environment: * java 1.8.151
> * log4j-api-2.9.1.jar
> * log4j-core-2.9.1.jar
> * log4j-web-2.9.1.jar
> * disruptor-3.3.6.jar
> Reporter: Laurent Hasson
>
> With the following code, by the time the program ends, a number of logs are
> missing in the output. They may be either lost or not flushed?
> {code:java}
> public class Log4JTest
> {
> protected static final Logger Log =
> LogManager.getLogger(Log4JTest.class.getName());
> protected static final int MAX = 10;
> public static void main(String[] args)
> {
> for (int i = 0; i < MAX; ++i)
> {
> for (int j = 0; j < MAX; ++j)
> {
> Log.fatal("Fatal i=" + i + "; j=" + j + ";");
> Log.error("Error i=" + i + "; j=" + j + ";");
> Log.warn("Warn i=" + i + "; j=" + j + ";");
> Log.info("Info i=" + i + "; j=" + j + ";");
> Log.debug("Debug i=" + i + "; j=" + j + ";");
> Log.trace("Trace i=" + i + "; j=" + j + ";");
> }
> }
> Log.info("DONE.");
> }
> {code}
> I'd expect the program to end and all log messages to be output properly,
> ending with the "DONE" message.
> If i change the config file to a rolling appender, i can observe the same
> behavior, i.e., missing messages.
> {code:xml}
> <RollingFile name="FILES" fileName="${log-path}/aaa.log"
> filePattern="${log-path}/aaa.%i.log.gz">
> <PatternLayout>
> <pattern>%d{MMdd.HHmmss.SSS}#%-3t %level{length=1} %15.15c{1}|
> %m%ex{20}%n</pattern>
> </PatternLayout>
> <Policies>
> <SizeBasedTriggeringPolicy size="100 MB" />
> </Policies>
> <DefaultRolloverStrategy max="99999" compressionLevel="6"/>
> </RollingFile>
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)