如何在 log4j 中压缩备份文件RollingFileAppender
我有以下log4j.properties文件,虽然超过了大小限制,但它正在创建备份文件但不压缩它。
log4j.appender.request=org.apache.log4j.RollingFileAppender
log4j.appender.request.File=${catalina.home}/webapps/Sample/WEB-INF/logs/FAW_l4j.log
log4j.appender.request.MaxFileSize=10KB
log4j.appender.request.MaxBackupIndex=3
log4j.appender.request.RollingPolicy.ActiveFileName =${catalina.home}/webapps/Sample/WEB-INF/logs/FAW_l4j.log-%d.log.
log4j.appender.request.RollingPolicy.FileNamePattern=${catalina.home}/webapps/Sample/WEB-INF/logs/FAW_l4j.log-%d.log.zip
log4j.appender.request.layout = org.apache.log4j.PatternLayout
log4j.appender.request.layout.ConversionPattern=%d %p [%c{3}] - [%t] - %X{ip}: %m%n