LOG4J2日志文件部分丢失
问题描述:
生产环境INFO日志切割单位为300MB,LOG4J2 默认对压缩文件只保留7个文件数量.
导致生产环境对7*300MB < 最大每个节点每天最大日志大小为60GB,存在日志部分丢失情况.
当前项目LOG4J2 版本:2.7
需做如下修改:
log4j2.conf配置文件在RollingFile 节点下增加:<DefaultRolloverStrategy max=“2000”> ,max值为2000防止日后业务量增加再次修改此值.
摘自
LOG4J2官方 供参考:
The maximum value of the counter. Once this values is reached older archives will be deleted on subsequent rollovers. The default value is 7.
http://logging.apache.org/log4j/2.x/manual/appenders.html#CustomDeleteOnRollover
评论
发表评论
|
|