2

How do I configure log4j properties to roll over every X minutes. I know that this can be configured based on size and yearly, monthly, daily basis. With the FileAppender I had wriiten custom code to do this, but it doesnt seem to work. Please suggest, if anyone has tried this before?

Shell
  • 21
  • 1
  • 2

1 Answers1

3

Use DailyRollingFileAppender for the purpose. http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

Dhrubajyoti Gogoi
  • 1,265
  • 10
  • 18
  • 1
    It appears that DailyRollingFileAppender cannot handle minute intervals other than 1 minute. For example every 5 minutes cannot be set. – Slobodan Pejic Feb 05 '18 at 17:13