4 Replies Latest reply on Jul 21, 2011 4:28 AM by jaikiran pai

    Log Rotation via jboss-logging.xml on AS 6

    codecab Newbie

      Hello JBoss community!

       

      I'm pretty new to JBoss AS6 and i'm struggeling with the configuration of the logging system. I tried to configure a size-based RollingFileAppender to save 5 backups of the logfile, each 500k in size. But what happens is, JBoss stops rotating the logfiles after the first backup was made. Logging still works and my log output is written to the logfile, but when the limit is exceeded, a second backup won't get created.

      So after a while i have a "server.log.1" which is just as big as the configured rotate-size, and a "server.log" which grows above this limit.

       

      I took the configuration right from the examples, no changes were made. Here's my /default/deploy/jboss-logging.xml:

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

      <logging xmlns="urn:jboss:logging:6.0" xmlns:b="urn:jboss:bean-deployer:2.0">

       

         <size-rotating-file-handler

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

               name="FILE"

               autoflush="true"

               append="true"

               rotate-size="500k"

               max-backup-index="5">

       

            <error-manager>

               <only-once/>

            </error-manager>

       

            <formatter>

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

            </formatter>

         </size-rotating-file-handler>

       

         <root-logger>

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

            <handlers>

               <handler-ref name="FILE"/>

            </handlers>

         </root-logger>

       

      </logging>

      {code}

       

      Unfortunately there's no documentation and i'm a bit sad that the provided examples do not work ;/

       

      Does anyone have any clue what i could have done wrong here? Did i forget something? Did i misunderstand something? Or is this just a bug?

       

      I need to get log rotation for JBoss 6 on windows to work properly, otherwise we cant go productive. Should we move a step backwards on JBoss 5 or 4.2.3, were log rotation works as expected?

       

      So long,

      Benedikt