Increasing file indexing on OnStartupTriggeringPolicy in log4j2

匆匆过客 提交于 2019-12-13 07:57:52

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/43406603/increasing-file-indexing-on-onstartuptriggeringpolicy-in-log4j2

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