2 Replies Latest reply on Jun 23, 2010 3:58 PM by hari patnaik

    How to limit the number of log using jboss-log4j and daily appender

    hari patnaik Newbie

      Hello, My first post:

      I am using jboss 4.3 and using jboss-log4j.xml for logging. Currently its rotating server.log Daily at 12:00 am, but it keeps logs for ever. I want to limit the number of logs i.e. lets say 15 days

      Please lemme know how to do that?

      This is what i am using :

      ----

      ----

      <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
            <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
            <param name="File" value="${jboss.server.log.dir}/server.log"/>
            <param name="Append" value="false"/>
            <param name="MaxFileSize" value="300KB"/>
            <param name="MaxBackupIndex" value="5"/>
            <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            <layout>
            <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
            </layout>
         </appender>

      ----

      ----

      Thanks

      Harry