0 Replies Latest reply on Apr 8, 2010 2:17 PM by vintubr

    Compress JBoss' Last server.log File With Log4j

    vintubr
      Hi All,
      I am new to the community, so, sorry if I am posting in the wrong place!
      As I commented in the description, today I am using JBoss' DailyRollingFileAppender and every night I have a new "server.log" file,
      because the last one was moved from "server.log" to "server.log.YYYY-MM-DD-HH".
      Below I am going to place part of my jboss-log4j.xml:
      <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="Threshold" value="INFO"/>
           <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
           <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
           </layout>
      </appender>
      
      I have tried to find this information all over the internet, but without success.
      This post is to ask you if there is a way to configure JBoss to compress the "server.log" file right after it is rolled from the log4j appender.
      I mean, when the file changes from: "server.log" to "server.log.YYYY-MM-DD-HH", the last one is compressed(it can be by gzip, compress, etc).
      Is there a way to do this? Or I will need to implement something external from JBoss?
      Thanks for your attention!
      Comments/experiences appreciated.