3 Replies Latest reply on Feb 27, 2013 6:28 PM by James Perkins

    Periodic Rotating File Handler does not rotate daily

    sammie88 Newbie

      Hi,

      I am using Jboss-as-7.1.1 .Final.  I have a problem with logging.  It seems that my (server, testejb, test) logs are not being renamed/rotated daily. I am expecting it to  be renamed daily

      with .yyyy-MM-dd suffix.  However if I use the suffix yyyy-MM-dd-HH (for hourly) it seems to work - I tested the hourly with testejb.log and test.log.  I use org.apache.log4j.logger in my application. I didnt have to include dependencies in the manifest to log4j.

      My configuration looks something like:

       

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

                      <append value="true"/>

                  </periodic-rotating-file-handler>

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

                      <formatter>

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

                      </formatter>

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

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

                      <append value="true"/>

                  </periodic-rotating-file-handler>

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

                      <formatter>

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

                      </formatter>

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

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

                      <append value="true"/>

                  </periodic-rotating-file-handler>

                  <logger category="com.arjuna">

                      <level name="DEBUG"/>

                  </logger>

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

                      <level name="DEBUG"/>

                  </logger>

                  <logger category="sun.rmi">

                      <level name="DEBUG"/>

                  </logger>

                  <logger category="jacorb">

                      <level name="DEBUG"/>

                  </logger>

                  <logger category="jacorb.config">

                      <level name="DEBUG"/>

                  </logger>

                  <logger category="com.test.conn.connector.jca.ra" use-parent-handlers="false">

                      <level name="DEBUG"/>

                      <handlers>

                          <handler name="TESTCONN"/>

                      </handlers>

                  </logger>

                  <logger category="com.test.conn.ejb" use-parent-handlers="false">

                      <level name="DEBUG"/>

                      <handlers>

                          <handler name="TESTEJB"/>

                      </handlers>

                  </logger>

                  <root-logger>

                      <level name="DEBUG"/>

                      <handlers>

                          <handler name="CONSOLE"/>

                          <handler name="FILE"/>

                      </handlers>

                  </root-logger>

              </subsystem>

       

      Thanks in advance for help!