2 Replies Latest reply on Mar 22, 2013 8:08 AM by Sueleyman Vurucu

    Extends from PeriodicRotatingFileHandler

    Sueleyman Vurucu Expert

      Hi guys,

       

      I want to extend the behaviour of PeriodicRotatingFileHandler. For that I create a jboss module and extends from PeriodicRotatingFileHandler and override only

       

        @Override

        protected void preWrite(ExtLogRecord record){

          super.preWrite(record);

          deleteOldFiles();

        }

       

       

      <custom-handler name="MyAppender" class="myg.handler.PeriodicRotatingFileHandlerExtended" module="my.libs">
                     
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                      </formatter>
                      <properties>
                           <property name="relativeTo" value="${jboss.server.log.dir}/app"/>
                          <property name="file" value="Application.log"/>
                          <property name="suffix" value=".yyyy-MM-dd"/>
                          <property name="maxBackupDays" value="2" /> <!-- This is my needed feature -->
                          <property name="append" value="true"/>
                      </properties>
                  </custom-handler>
      

       

      I can debug this handler. It semms so thats works fine but my logfile is everytime empty.  Did I miss something ??