title: Does log4j provide any mechanism to daily archive log?
body: <p>Does log4j 1.2 provide any mechanism to daily archive log?</p>
  
  <p>Everybody say that i can do it via org.apache.log4j.rolling.TimeBasedRollingPolicy but in sources of 1.2.15 i don't see any TimeBasedRollingPolicy class. </p>
  
  <p>I found a resolution :</p>
  
  <pre><code>&lt;appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender"&gt;
     &lt;errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/&gt;
  
     &lt;rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy"&gt;
         &lt;param name="ActiveFileName" value="${jboss.server.log.dir}/server.log"/&gt;
         &lt;!-- roll log file once a day --&gt;
         &lt;param name="FileNamePattern" value="${jboss.server.log.dir}/archives/server.log.%d.gz"/&gt;
     &lt;/rollingPolicy&gt;
  
     &lt;!-- A PatternLayout that limits the number of lines in stack traces --&gt;
     &lt;layout class="com.mtvi.log4j.StackTraceLimitingPatternLayout"&gt;
         &lt;!-- The full pattern: Date MS Priority [Category] (Thread) Message\n --&gt;
         &lt;param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/&gt;
     &lt;/layout&gt;
  &lt;/appender&gt;
  </code></pre>