Need a working example of configuring log4j RollingFileAppender via properties

前端 未结 4 1032
北恋
北恋 2021-02-02 18:10

I am using log4j for logging, and a property file for configuration. Currently, my log files are too big (3.5 GB is too large for a log file). So think I need to use Ro

4条回答
  •  孤街浪徒
    2021-02-02 18:41

    Your issue might be with the fact that you are specifying a DatePattern. The DatePattern is meant to be used with the DailyRollingFileAppender to specify the date that the log file should roll. I don't believe it can be used in conjunction with the MaxFileSize and MaxBackupIndex attributes. Log4j lets you roll files based on file size or date but not both.

提交回复
热议问题