Log4j2 RollingFile appender start archiving after N days?

让人想犯罪 __ 提交于 2019-12-13 17:07:34

问题


This is the conf I am using at the moment:

<RollingFile name="RollingFileAppender"
    fileName="/tmp/test.log" filePattern="/tmp/test-%i.log.gz" ignoreExceptions="false">
  <PatternLayout pattern="%m%n" />
  <Policies>
    <SizeBasedTriggeringPolicy size="100 MB" />
  </Policies>
  <DefaultRolloverStrategy max="5" />
</RollingFile>

Notice the '.gz' extension that make log4j2 compress the rotated log files.

I would like to keep 5 files uncompressed and start compressing only after that. Is there a way to start the compression after N rotations?

来源:https://stackoverflow.com/questions/30880246/log4j2-rollingfile-appender-start-archiving-after-n-days

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!