0 Replies Latest reply on Jun 11, 2015 7:45 AM by s k

    JBOSS 4 log4j

    s k Newbie

      Hi,

       

      We are using JBOSS 4 and log4j for logging purpose.

      We have mentioned below configurations in log4j

       

      <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="5000KB"/>

            <param name="MaxBackupIndex" value="20"/>

        

            <param name="DatePattern" value="'.'yyyy-MM-dd"/>

       

            <layout class="org.apache.log4j.PatternLayout">

               <!-- The default pattern: Date Priority [Category] Message\n -->

               <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

       

               <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n

               <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>

                -->

            </layout>

         </appender>

       

       

      It is creating 20 server.log files of size 5 MB each.

       

      Issue -

      We suddenly got one issue -

      We can see only 20 log files in log folder but when we run linux lsof (list of open files) command it is shwoing mutliple  server.log.20  files. And resulting in increasing size on server.

      JBOSS restart can resolve the issue. But does anybody know the root cause and how we can prevent this in future.

       

      Thanks in advance.