7 Replies Latest reply on Aug 15, 2013 2:18 PM by Hai-Yun Du

    Periodic Rotating File Handler not working

    Hai-Yun Du Newbie

      I would like to use two period rotating file handlers one for general logs and the other for sql logs set to rotate every day. I have tried testing it for every minute  yyyy-MM-dd-HH-mm and it works for server.log but not for sql.log. The sql.log file is not even being generated and the logs from category org.hibernate.SQL is being appended into server.log

       

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

          <console-handler name="CONSOLE">

              <level name="INFO"/>

              <formatter>

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

              </formatter>

          </console-handler>

          <periodic-rotating-file-handler name="FILE" autoflush="true">

              <formatter>

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

              </formatter>

              <file relative-to="jboss.server.log.dir" path="server.log"/>

              <suffix value=".yyyy-MM-dd-HH-mm"/>

              <append value="true"/>

          </periodic-rotating-file-handler>

          <periodic-rotating-file-handler name="SQL" autoflush="true">

              <formatter>

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

              </formatter>

              <file relative-to="jboss.server.log.dir" path="sql.log"/>

              <suffix value=".yyyy-MM-dd-HH-mm"/>

              <append value="true"/>

          </periodic-rotating-file-handler>

          <logger category="org.hibernate.SQL" use-parent-handlers="false">

              <level name="DEBUG"/>

              <handlers>

                  <handler name="SQL"/>

              </handlers>

          </logger>

          <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="INFO"/>

              <handlers>

                  <handler name="CONSOLE"/>

                  <handler name="FILE"/>

              </handlers>

          </root-logger>

      </subsystem>