tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BobbyBear <rcasa...@hotmail.com>
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
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory
createDelegate
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
jar:file:/Users/Bob/apache-tomcat-7.0.52/wtpwebapps/PlayMap/WEB-INF/lib/log4j-core-2.0-rc1.jar!/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat
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",
Configuration(/Users/Bob/apache-tomcat-7.0.52/wtpwebapps/TRSMapp/WEB-INF/classes/log4j2.xml),
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
createApplication
INFO: Deployed
Application(path=/Users/Bob/apache-tomcat-7.0.52/wtpwebapps/PlayMap)
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: http://openejb.979440.n4.nabble.com/log4j2-initialized-too-early-tp4668307.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message