5 Replies Latest reply on Feb 5, 2011 10:13 AM by nickarls

    How to control "server.log" file size in JBoss 6.0.GA release?

    jbossuser71

      Hi All,

      I am using JBoss 6.0.0-GA release and I want my "server\default\log\server.log" file to be rotated based on file-size.

       

      I have modified my "server\default\deploy\jboss-logging.xml" file. I commented the default "time/date based rolling handler" block there and uncommented "size based file rolling appender" block which now looks like as:

              <size-rotating-file-handler

                file-name="${jboss.server.log.dir}/server.log"

                name="FILE"

                autoflush="true"

                append="true"

                rotate-size="100k"

                max-backup-index="5">

       

             <error-manager>

                <only-once/>

             </error-manager>

       

             <formatter>

                <pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>

             </formatter>

          </size-rotating-file-handler>

      .

      .

      .

      .

       

         <root-logger>

              <!-- Set the root logger priority via a system property, with a default value. -->

              <level name="${jboss.server.log.threshold:INFO}"/>

              <handlers>

                  <handler-ref name="CONSOLE"/>

                  <handler-ref name="FILE"/>

              </handlers>

          </root-logger>

       

       

       

       

      This should mean that whenever the server.log file will grow in size more than 100K, a new server.log file will be created and I will have at most 5 such "server.log" files like "server.log.1, server.log.2, server.log.3, etc.".

      But nothing this happens, I am still having a single occurrence of "server.log" file (as before) which grows in size as time goes on.

       

      Is there anythng else I have to change?

      In previous version of Jboss, we used to have "jboss-log4j.xml" file under "server\defaut\conf" directory - which I cannot find in Jboss6.

      Can any one pls. suggest if I am missing any step here?

       

       

       

       

       

       

      Thanks in advance,

      - kuntal