logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Max backup index and daily rolling
Date Thu, 17 Nov 2005 20:49:37 GMT

On Nov 17, 2005, at 1:29 PM, Steve Pruitt wrote:

> I think having the same max backup index setting for daily rolling  
> files
> would be useful.  I would still like to limit the sheer number of log
> files.  I guess I can put it in the suggestion box.

Unfortunately, it is not a simple problem.  If you scan the current  
directory looking for files that match the pattern, you would not  
handle the case where format specifiers were used in the directory  
name or if some significant part of the date was suppressed (like the  
year or month was dropped).  If you did a brute force attempt, then  
you'd likely have to determine from the pattern the interval to use  
and then walk backwards some arbitrary duration before you decided  
that you did not need to concern yourself with log files before 1960  
or so.

If you use RollingFileAppender with a time based trigger and max  
window rolling policy, you could do a time based rollover with a  
limited number of files, but the file names would contain an index  
and not a formatted date. 
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message