Increasing file indexing on OnStartupTriggeringPol

2019-09-19 12:14发布

While rotating the file on OnStartupTriggeringPolicy in log4j2, 7 times the files is getting created with indexing 1,2,3 to 7 as shown below. After that it is over writing to the first one.

packs-03-29-2017-1.zip 
packs-03-29-2017-2.zip 
packs-03-29-2017-3.zip 
packs-03-29-2017-4.zip 
packs-03-29-2017-5.zip 
packs-03-29-2017-6.zip 
packs-03-29-2017-7.zip

Can someone tell me how to increase the number of file indexing in log4j2.

标签: java log4j2
1条回答
不美不萌又怎样
2楼-- · 2019-09-19 12:37

Assuming that you're using the DefaultRolloverStrategy you can simply increase your "max" to the desired value within your configuration file.

See also:

Log4j2 Manual: Rollover Strategies

查看更多
登录 后发表回答