tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: log4j2 initialized too early?
Date Sat, 05 Apr 2014 08:11:14 GMT
Ok go it

log4J uses a servlet container initialzer to get web info which is of
course initialized after openejb part of tomee and ejb are scanned (so
loaded) before.

You can consider this issue from several point of view:
1) this is an openejb issue which shouldn't load classes before -> if
we fix it we loose so much control of the apps that ears will be
totally broken and potentially a lot of wars too. (I dont get too much
into details here but I'm really -1 for it + wouldnt be before 1-2
months I guess since needs advanced changes)
2) this is a log4j issue -> log4j could use some tomcat internals (or
jmx) to get the info too I think
3) not a reall issue since you can not use static loggers

Romain Manni-Bucau
Twitter: @rmannibucau

2014-04-05 1:54 GMT+02:00 BobbyBear <>:
> I have a small eclipse project at
> which shows the issue.
> DaBean is a Stateless EJB with a property called "logger" which is
> initialized to log4j2.
> There are two lines which allow me to initialize it in two different ways:
> [1] initializing it with "static" creates a log file called
> ".${web:contextPath}.log" which is incorrect
> [2] initializing it without "static" create a log file called
> "TestLog4j2.log" which is correct
> I am using tomcat 7.0.53 but have seen the behavior with 7.0.52 as well. I
> pulled the latest trunk for tomee to see if the issue has gone away, but it
> has not.
> By creating a war for each scenario and deploying, starting and stopping in
> tomcat/bin... you will see the log files created there upon startup.
> --
> View this message in context:
> Sent from the OpenEJB User mailing list archive at

View raw message