How to rotate log files based on time rather than size in Log4j?

后端 未结 5 1089
别跟我提以往
别跟我提以往 2020-12-14 02:56

I use Log4j with the RollingFileAppender to create a log rotation based on size.

How can I configure it to log to each file for a certain amount of

5条回答
  •  情歌与酒
    2020-12-14 02:59

    You need to use the DailyRollingFileAppender. Despite its misleading name it can be configured in a to run at configurable time periods up to minutes.

提交回复
热议问题