Getting log4j:WARN "No appenders could be found for logger" and "Please initialize the log4j system properly" when undeploy Spring based web application in JBoss EAP
Issue
I got the following log4j WARN log messages in server.log when I undeloyed our Spring based web application in JBoss EAP.
INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) undeploy, ctxPath=/myapp
INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp]] (HDScanner) Shutting down log4j
INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp]] (HDScanner) Closing Spring root WebApplicationContext
ERROR [STDERR] (HDScanner) log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.XmlWebApplicationContext).
ERROR [STDERR] (HDScanner) log4j:WARN Please initialize the log4j system properly.
ERROR [STDERR] (HDScanner) log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
The log4j library and its configuration file (log4j.properties
or log4j.xml
) are certainly placed in class-path of WAR (e.g. WEB-INF/lib
, WEB-INF/classes
). What is a cause of this issue and How can I resolve this?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 4.x
- 5.x
- Application using Spring and log4j
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.