You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by lb <lb...@gmail.com> on 2015/08/07 11:10:55 UTC

Multi thread initialization problem

Hi,
I have wrote a very simple example which has a behaviour I do not expect:

If I call LogManager.getLogger(..) from two threads, only one of the
loggers logs what I'd expect but if I add an additional call to
LogManager.getLogger(..) before the threads are started, I see what I'd
expect so it looks like there is a problem in multi threaded initialization.

You can fine the code and the configuration here:

-
https://github.com/lburgazzoli/lb-chronicle/blob/master/chronicle-examples/chronicle-logger-log4j2/src/main/java/com.github.lburgazzoli.openhft.examples.chronicle.logger.log4j2/MtLogging.java
-
https://github.com/lburgazzoli/lb-chronicle/blob/master/chronicle-examples/chronicle-logger-log4j2/src/main/resources/log4j2.xml

Am I doing something wrong ?

Regards,
Luca