4 Replies Latest reply on Apr 15, 2013 8:42 AM by Claudio Riedi

    Log4j logging works sometimes, sometimes not

    Claudio Riedi Newbie

      I have another jboss 7 - log4j issue

      I'm using jboss 7.1.1.Final standalone and my application consists of a war and several jars within an ear-File.

      The structure looks like this:


          |--- lib

          |       |--- log4j-1.2.16.jar

          |--- META-INF

          |       |--- jboss-deployment-structure.xml

          |--- web.war

          |       |--- WEB-INF

          |                 |--- clasess

          |                          |--- log4j.xml

          |--- mymodule1.jar

          |--- mymodule2.jar





      <?xml version="1.0" encoding="UTF-8"?>


      <ear-subdeployments-isolated>false</ear-subdeployments-isolated> <deployment>


                  <module name="org.apache.log4j" />

                  <module name="org.jboss.logging" />

                  <module name="org.jboss.logmanager" />



                  <module name="org.quartz" export="true"/>

                 <module name="org.apache.commons.lang" export="true"/>

                 <module name="org.apache.commons.configuration" export="true"/>   



              <sub-deployment name="web.war">


                     <module name="org.apache.log4j" />

                     <module name="org.jboss.logging" />

                     <module name="org.jboss.logmanager" />






      Sometimes the logging works perfectly, but after a server restart (without changing the ear) no logs were written.

      But then the following message appears in the server.log


      16:28:37,616 ERROR [stderr] (http- log4j:WARN No appenders could be found for logger (ch.treibauf.matchbox.frontend.login.controller.LoginController).

      16:28:37,632 ERROR [stderr] (http- log4j:WARN Please initialize the log4j system properly.

      16:28:37,632 ERROR [stderr] (http- log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


      I'm confused. Any help is appreciated.