aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j Question" Watch "log4j Question" New topic
Author

log4j Question

PNS Subramanian
Ranch Hand

Joined: Jul 13, 2004
Posts: 150
Currently, i am using log4j in my application for logging purpose. I make use of DailyRollingFileAppender with the file rolling twice each day (AM/PM). This creates as much as 60 different log files each month (2 * 30 days) - i want this to be limited to 10 log files. Is there anyway, this can be done ? I also want to preserve the properties of the DailyRollingFileAppender - use different file names for AM and PM.

Appreciate any help in this regard.
Pavan Panduga
Ranch Hand

Joined: Jun 12, 2002
Posts: 68
A weekly roll over is possible with this config option,
'.'yyyy-ww

For more details, you may want to look at the DailyRollingFileAppender documentation. I'd like to think that there would be an option available somewhere, may not be a straight forward one to your exact requirement.

Good Luck,
 
jQuery in Action, 2nd edition
 
subject: log4j Question
 
Similar Threads
DailyRollingFileAppender
Jakarta Commons Logging
Problems with DailyRollingFileAppender in log4j
Append date in RollingFileAppender
How to change the name of file in log4j.properties file