title: log4j configurations with daily rolling, gzip and max backup files
body: <p>Is there an appender that I can use that will get me daily rolling, compression and max files?</p>
  <p>I can get daily rolling file with compression using <code>apache-log4j-extras</code> with this configuration:</p>
  <pre><code>&lt;appender name=&quot;debugFileRolling&quot; class=&quot;org.apache.log4j.rolling.RollingFileAppender&quot;&gt;
      &lt;!-- The active file to log to --&gt;
      &lt;param name=&quot;file&quot; value=&quot;debug.log&quot; /&gt;
      &lt;param name=&quot;append&quot; value=&quot;true&quot; /&gt;
      &lt;param name=&quot;encoding&quot; value=&quot;UTF-8&quot; /&gt;
      &lt;rollingPolicy class=&quot;org.apache.log4j.rolling.TimeBasedRollingPolicy&quot;&gt;
          &lt;param name=&quot;FileNamePattern&quot; value=&quot;/%d{yyyy-MM-dd}-debug.log.gz&quot; /&gt;
      &lt;/rollingPolicy&gt;
  
      &lt;layout class=&quot;org.apache.log4j.PatternLayout&quot;&gt;
          &lt;param name=&quot;ConversionPattern&quot; value=&quot;%-5p %d [%t] %c: %m%n&quot; /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  </code></pre>
  <p>But I can't specify <code>MaxBackupIndex</code> as in <code>org.apache.log4j.RollingFileAppender</code> (note the slight namespace difference between the two).</p>
  <p>I would like both without having to implement my own <code>FileAppender</code>, <code>TriggeringPolicy</code>, or <code>RollingPolicy</code>.</p>