• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

log4j - limit numer of log Files for DailyRollingFileAppender

 
Greenhorn
Posts: 21
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to limit the number of log files for a DailyRollingFileAppender. I search for a parameter like maxBackupIndex (in RollingFileAppender) but can not find one. Is there really no way to limit the number of log-Files?

What is the strategy to ensure that the (number) of log files do not "overrun". Delete them manually?

Thanks and best regards
Klaus
 
Marshal
Posts: 27534
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could write a subclass of DailyRollingFileAppender that does have such a parameter, and that does delete the N-th oldest log file when it rolls.
 
reply
    Bookmark Topic Watch Topic
  • New Topic