如何自动从log4j日志文件创建zip存档?

时间:2016-10-03 11:23:38

标签: log4j

下面是我的log4j.properties文件

 log4j.rootCategory= ALL,roll
 log4j.appender.roll=org.apache.log4j.rolling.RollingFileAppender
 log4j.appender.roll.rollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
 log4j.appender.roll.rollingPolicy.ActiveFileName=log/worker.log
 log4j.appender.roll.rollingPolicy.FileNamePattern=worker.%d{yyyyMMddHHmm}.log.zip
 log4j.appender.roll.layout=org.apache.log4j.PatternLayout
 log4j.appender.roll.layout.ConversionPattern=[%d{DATE}] [%p] - %m%n

0 个答案:

没有答案