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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -