[
https://issues.apache.org/jira/browse/LOG4J2-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13944394#comment-13944394
]
Remko Popma commented on LOG4J2-537:
------------------------------------
Gleb,
Sorry for the late response.
You seem to be using the Disruptor extensively in your application. When you
pass an Executor to your Disruptor instances, do you use a custom ThreadFactory
to ensure all threads are daemon threads? This is what we do in log4j2.
Is it possible that your application has other non-daemon threads still running
when the application ends? That would explain why the application does not end.
Moonumi:
In a standalone application (run from the command line) I cannot reproduce the
problem with the sample application you provided.
But, interestingly, I can reproduce the problem when running from Eclipse. In
Eclipse the application always hangs, whether I use Async loggers or not...
{code}
public static void main(String[] args) {
// uncomment below line to use Async Loggers
// System.setProperty("Log4jContextSelector",
"org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
Logger logger = LogManager.getLogger();
logger.info("Hello, World!");
}
{code}
> application does not end.
> -------------------------
>
> Key: LOG4J2-537
> URL: https://issues.apache.org/jira/browse/LOG4J2-537
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-beta9
> Environment: jdk1.6.0_45 64bit
> Reporter: moonumi
> Assignee: Remko Popma
> Labels: patch
>
> The helloworld program below does not end. (Process keeps running.)
> configuration:
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="error">
> <Appenders>
> <Console name="Console" target="SYSTEM_OUT">
> <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
> <!-- Flow tracing is most useful with a pattern that shows location.
> Below pattern outputs class, line number and method name. -->
> <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M -
> %msg%xEx%n"/>
> </Console>
> <File name="log" fileName="test.log" append="false">
> <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M -
> %msg%xEx%n"/>
> </File>
> </Appenders>
> <Loggers>
> <Root level="trace">
> <AppenderRef ref="log"/>
> </Root>
> </Loggers>
> </Configuration>
> {code}
> source
> {code}
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
>
> public class HelloWorld {
> private static Logger logger = LogManager.getLogger();
> public static void main(String[] args) {
> logger.info("Hello, World!");
> }
> }
> {code}
> libs:
> disruptor-3.2.0.jar
> log4j-api-beta9.jar
> log4j-core-beta9.jar
> delete file appender and change [AppenderRef ref="Console"] in [Root] work
> fine.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]