Is it possible to compress log files (I doing it via RollingFileAppender )?
See Question&Answers more detail:osIs it possible to compress log files (I doing it via RollingFileAppender )?
See Question&Answers more detail:oslog4j extras has support for that.
Just add the following to your RollingFileAppender
configuration and have the filename end in .gz to automagically compress your log files:
<appender...>
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="/wombat/foo.%d{yyyy-MM}.gz"/>
</rollingPolicy>
</appender>
For more details check the Javadoc