1 Reply Latest reply on Nov 12, 2013 9:51 AM by Immo Benjes

    Problems with configuring logging in JBoss EAP 6.1

    Immo Benjes Newbie

      Hi,

       

      I am trying to configure the logging on my dev system to show DEBUG messages but only DEBUG messages from my applicaiton, not from other modules like JSF, Hibernate etc.

       

      So far I've confiured:

       <subsystem xmlns="urn:jboss:domain:logging:1.2">
                  <console-handler name="CONSOLE">
                      <level name="DEBUG"/>
                      <formatter>
                          <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%X{username}][%C][%X{cid}][%c{1}] (%3.5t) %s%E%n"/>
                      </formatter>
                  </console-handler>
                  <periodic-rotating-file-handler name="FILE" autoflush="true">
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%X{username}][%X{cid}][%c{1}] (%3.5t) %s%E%n"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="server.log"/>
                      <suffix value=".yyyy-MM-dd"/>
                      <append value="true"/>
                  </periodic-rotating-file-handler>
                  <periodic-rotating-file-handler name="EDI">
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%X{username}][%X{cid}][%c{1}] (%3.5t) %s%E%n"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="edi.log"/>
                      <suffix value=".yyyy-MM-dd"/>
                      <append value="true"/>
                  </periodic-rotating-file-handler>
                  <periodic-rotating-file-handler name="REQUESTS">
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%X{username}][%c] [%c{1}] %s%E%n"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="requests.log"/>
                      <suffix value=".yyyy-MM-dd"/>
                      <append value="true"/>
                  </periodic-rotating-file-handler>
                  <logger category="com.sun.faces">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.sun.faces.facelets">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.sun.faces.config">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.sun.faces.facelets.compiler">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.sun.faces.lifecycle">
                      <level name="INFO"/>
                  </logger>
                  <logger category="javax.xml.bind">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.sun.faces.application">
                      <level name="INFO"/>
                  </logger>
                  <logger category="javax.faces">
                      <level name="WARN"/>
                  </logger>
                  <logger category="com.arjuna">
                      <level name="WARN"/>
                  </logger>
                  <logger category="org.apache.tomcat.util.modeler">
                      <level name="WARN"/>
                  </logger>
                  <logger category="org.jboss.as.config">
                      <level name="DEBUG"/>
                  </logger>
                  <logger category="sun.rmi">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb.config">
                      <level name="ERROR"/>
                  </logger>
                  <logger category="org.quartz">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.odyssey.locuslive">
                      <level name="DEBUG"/>
                  </logger>
                  <logger category="org.hibernate">
                      <level name="INFO"/>
                  </logger>
                  <logger category="com.sun">
                      <level name="INFO"/>
                  </logger>
                  
                  <logger category="org.xnio">
                      <level name="INFO"/>
                  </logger>
                  <logger category="org.apache.catalina">
                      <level name="INFO"/>
                  </logger>
                  <logger category="org.jboss">
                      <level name="INFO"/>
                  </logger>
                  <logger category="org.jboss.as">
                      <level name="INFO"/>
                  </logger>
                  <logger category="org.infinispan">
                      <level name="INFO"/>
                  </logger>
                  <logger category="org.richfaces">
                      <level name="INFO"/>
                  </logger>
                  <root-logger>
                      <level name="DEBUG"/>
                      <handlers>
                          <handler name="CONSOLE"/>
                          <handler name="FILE"/>
                      </handlers>
                  </root-logger>
              </subsystem>
      

       

      The <logger> settings seem to work fine for most e.g. a <logger category="org.hibernate"> <level name="INFO"/></logger> will filter out all the DEBUG messages.

      However I can't seem to be able to filter out FINE messages from com.sun.faces. I've tried all combination just specifying com.sun, com.sun.faces, com.sun.faces.facelets, etc but the FINE messages from com.sun still fill up my logging, making it basically useless as there is too much information logged. What am I doing wrong here? I thought specifying a category "com.sun" would filter out everything that starts with that category.

        • 1. Re: Problems with configuring logging in JBoss EAP 6.1
          Immo Benjes Newbie

          Hi,

           

          as so often, shortly after posting I found the answer. The categories for JSF have nothing to do with the package name of the classes it seems

            <logger category="javax.enterprise.resource.webcontainer.jsf.context">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.managedbean">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.renderkit">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.facelets">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.application">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.taglib">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.lifecycle">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.config">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.timing">
                          <level name="INFO"/>
                      </logger>
                      <logger category="javax.enterprise.resource.webcontainer.jsf.resource">
                          <level name="INFO"/>
                      </logger>
          

           

          That does the trick