Logback, set max history files per day

巧了我就是萌 提交于 2019-11-28 03:16:43

问题


I use TimeBasedRollingPolicy and SizeAndTimeBasedFNATP triggering policy for my logback configuration. The rollover of log files is set to happen every day and it will also be triggered if log file size goes beyond a limit.

If I do setMaxHistory(10) on TimeBasedRollingPolicy with a daily roll over, then it will archive all log files in last 10 days. But what I want is to set maxHIstory on SizeAndTimeBasedFNATP each day.

Is this possible with logback?


回答1:


With SizeAndTimeBasedFNATP and MaxHistory set to 10, the logs older than 10 days will be removed (assuming daily rollover schedule). Size is not factored in the into removal logic.



来源:https://stackoverflow.com/questions/7934829/logback-set-max-history-files-per-day

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