2 Replies Latest reply on Aug 29, 2012 12:29 PM by bart__

    Problem with custom loggin handler

    bart__

      Hi,

       

      i use two  versions of Jboss:

       

      Jboss 6 EAP and Jboss 7.1 GA

       

      with the same application and the same configuration file "domain.xml"

       

      I configure my handlers in domain.xml:

       

       

                     <periodic-rotating-file-handler name="Handler1" autoflush="true">
                          <level name="INFO"/>
                          <formatter>
                              <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                          </formatter>
                          <file relative-to="jboss.server.log.dir" path="file1.log"/>
                          <suffix value=".yyyy-MM-dd"/>
                          <append value="true"/>
                      </periodic-rotating-file-handler>
                      <periodic-rotating-file-handler name="Handler2" autoflush="true">
                          <level name="INFO"/>
                          <formatter>
                              <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                          </formatter>
                          <file relative-to="jboss.server.log.dir" path="file2.log"/>
                          <suffix value=".yyyy-MM-dd"/>
                          <append value="true"/>
                      </periodic-rotating-file-handler>
      
                   <logger category="com.spa" use-parent-handlers="false" >
                          <level name="INFO"/>
                          <handlers>
                              <handler name="Handler1"/>
                          </handlers>
                      </logger>
                      <logger category="com.spa.data.view" use-parent-handlers="false">
                          <level name="INFO"/>
                          <handlers>
                              <handler name="Handler2"/>
                          </handlers>
                      </logger>
      
      

       

      When I start Jboss 7.1 with profile=ha my application logs into file1.log and file2.log but when I start Jboss 6 EAP with the same configuration, my application logs into file called "log.txt" and not in "file1.log or file2.log"

       

      The file "log.txt" is created in JBOSS_HOME while file1.log is created in JBOSS_PATH_LOG how i set.

       

      Anyone can me help?

       

      Thanks.

        • 1. Re: Problem with custom loggin handler
          jamezp

          Does your application happen to have a log4j configuration file or a logging.properties file? With EAP 6 per-deployment logging was introduced where it looks for a configuration file and configures logging for your application. If you don't want to use that logging configuration you could either remove it or set the org.jboss.as.logging.per-deployment system property to false.

           

          --

          James R. Perkins

          • 2. Re: Problem with custom loggin handler
            bart__

            Thanks for the reply I solved it with your help.

             

            Best Regards, Emanuele.