java - log4j - compress log file to gz on fly -


is possible setup log4j create gziped log files without creating intermediate .log files? there several rolling strategies (rolling date, etc), creates unzipped files first.

you can create own appender extending org.apache.log4j.rollingfileappender , overriding current logic implementing own optimized implementation version. zip current file , discard rolling log file (default implementation of rollingfileappender). example:

log4j.appender.{name}=br.com.sample.myziprollingfileappender 

you can "google" , search implementation examples using java.util.zip.zipoutputstream or java.util.zip.gzipoutputstream zip current file.


Comments

Popular posts from this blog

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -