1 Reply Latest reply on Mar 13, 2009 1:33 PM by Peter Johnson

    MaxBackupIndex limit in JBoss-eap-4.3

    Jerrold Eads Newbie

      I'm trying to configure the jboss-log4j.xml file for a size based appender:

       <!-- A size based file rolling appender -->
       <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
       <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="100000KB"/>
       <param name="MaxBackupIndex" value="30"/>
       <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

      If I set the MaxBackupIndex=8 everything seems to work as described i.e. when the server.log size hits MaxFileSize it is copied to server.log.1 and a new server.log starts. But with the above configuration when the server.log size hits MaxFileSize the server.log is truncated and no indexed file is created which, as I read, is what should happen if the MaxBackupIndex is set to 0? So is there a limit to the value for MaxBackupIndex ?


      Boat Drinks

        • 1. Re: MaxBackupIndex limit in JBoss-eap-4.3
          Peter Johnson Master

          I tried your settings (well, I set MaxFileSize to a smaller number so that I could force new log files), and got the expected results - server.log.1 and so on. There should not be a limit to MaxBackupIndex.

          Try setting the log4j.debug system property (add "-Dlog4j.debug" to JAVA_OPTS in run.bat or run.conf). This will cause log4j to print out some initialization information. Perhaps that will help pinpoint the issue.