1 Reply Latest reply on Jul 29, 2013 8:28 PM by James Perkins

    Jboss AS 7 logging on wrong level

    Tekin Omer Newbie

      Hi.

       

                I have been trying to use my own log4j.xml file for logging, as suggested here:

      https://docs.jboss.org/author/display/AS71/How+To#HowTo-HowdoIuselog4j.propertiesorlog4j.xmlinsteadofusingtheloggingsubsystemconfiguration%3F

       

                I did the following things:

      - I created the jboss-deployment-structure.xml file in WEB-INF (since my application is a WAR file) with the corresponding content;

      - I put log4j-1.2.16.jar in my build path;

      - created log4j.xml in src/main/resources (this is where Spring Roo put the file when it generated the project).

       

           This way, my logging messages from my classes are displayed ok, but errors that bubble up and are caught by DispatcherServlet are shown at DEBUG level in the Console:


      12:06:30,668 DEBUG [org.springframework.web.servlet.DispatcherServlet] (http-localhost-127.0.0.1-8080-3) Handler execution resulted in exception - forwarding to resolved error view: ModelAndView: reference to view with name 'uncaughtException'; model is {exception=java.lang.NullPointerException}: java.lang.NullPointerException      at ro.radcom.muzee.bo.impl.JmsServiceImpl.sendMessage(JmsServiceImpl.java:29) [classes:]      at ro.radcom.muzee.web.HomeController.redirectGet(HomeController.java:56) [classes:]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_33]      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_33] ....

       

                In standalone.xml, the logging part looks like this:

      <subsystem xmlns="urn:jboss:domain:logging:1.1">

                  <console-handler name="CONSOLE">

                      <level name="DEBUG"/>

                      <formatter>

                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                      </formatter>

                  </console-handler>

                  <logger category="com.arjuna">

                      <level name="WARN"/>

                  </logger>

                  <logger category="org.apache.tomcat.util.modeler">

                      <level name="WARN"/>

                  </logger>

                  <logger category="sun.rmi">

                      <level name="WARN"/>

                  </logger>

                  <logger category="jacorb">

                      <level name="WARN"/>

                  </logger>

                  <logger category="jacorb.config">

                      <level name="ERROR"/>

                  </logger>

                  <root-logger>

                      <level name="DEBUG"/>

                      <handlers>

                          <handler name="CONSOLE"/>

                      </handlers>

                  </root-logger>

              </subsystem>

          

                Also, my log4j.xml contains this:

       

      <logger name="org.springframework.security">

                          <level value="info" />

                </logger>

            but in the console there are some DEBUG level logs such as: "12:06:30,659 DEBUG [org.springframework.security.web.access.intercept.FilterSecurityInterceptor]".

       

            1. What could be the causes?

            2. Are these 2 problems related in some way?

         

           Any help would be appreciated .

       

       

           Thank you.