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