How do you get log4j to roll files based on date and size?

后端 未结 6 597
囚心锁ツ
囚心锁ツ 2020-12-02 17:11

So log4j comes with two existing log rollers: RollingFileAppender, and DailyRollingFileAppender. Has anyone heard of an appender that does both of what the former do?

<
6条回答
  •  暖寄归人
    2020-12-02 17:51

    Looks like you want a mix of the http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html and the http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html.

    You'll have to code by yourself. The good news is: you'll just have "merge" those classes functionality, no "low level" new code required.

提交回复
热议问题