tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BobbyBear <>
Subject log4j2 initialized too early?
Date Fri, 21 Mar 2014 20:39:47 GMT

It seems like log4j2 is being initialized too early. This is a problem
because we rely on the application server context for various logging
configuration values.

What I see is this:

Mar 21, 2014 4:26:40 PM
INFO: PersistenceUnit(name=PlayMap,
provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider
time 232ms
2014-03-21 16:26:41,180 DEBUG Generated plugins in 0.000022000 seconds
2014-03-21 16:26:41,189 DEBUG Found Plugin Map at
2014-03-21 16:26:41,379 DEBUG Generated plugins in 0.198293000 seconds
2014-03-21 16:26:41,469 DEBUG Generated plugins in 0.088339000 seconds
2014-03-21 16:26:41,472 DEBUG Calling createLayout on class
org.apache.logging.log4j.core.layout.PatternLayout for element PatternLayout
with params(pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n",
null, charset="null", alwaysWriteExceptions="null", noConsoleNoAnsi="null")
2014-03-21 16:26:41,564 DEBUG Generated plugins in 0.090932000 seconds

DEBUG statements show log4j2 initializing somewhere along the openjpa start.

Later on we see this:

Mar 21, 2014 4:26:42 PM org.apache.openejb.assembler.classic.Assembler
INFO: Deployed
Mar 21, 2014 4:26:42 PM org.apache.catalina.core.ApplicationContext log
INFO: Log4jServletContextListener ensuring that Log4j starts up properly.

Without tomee, log4j2 works fine and the DEBUG statements are seen right
after the INFO statement above. So there is some difference in loading.

Note that I'm using log4j2, not log4j. Also, I'm using a fairly recent local
build which works on tomcat-7.0.52

Has anyone gotten log4j2 with the WebLookups, "${web:contextPath}" for
example, from the servletContext to work?

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message