You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Steve Pruitt <SP...@exstream.com> on 2005/11/17 20:29:48 UTC
Max backup index and daily rolling
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.
-S
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Max backup index and daily rolling
Posted by Curt Arnold <ca...@apache.org>.
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