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 DM <do...@yahoo.co.uk> on 2007/03/01 16:43:03 UTC

maxBackupIndex with DailyRollingFileAppender

Hi,

When using a DailyRollingFileAppender, is there any way to specify the maximum number of files which should be kept? I know that the RollingFileAppender supports a maxBackupIndex property, but it seems this is not supported by DailyRollingFileAppender. I don't want to use RollingFileAppender because I want the files to rollover every day, rather than when they reach a certain size. So my requirements are:

- Roll files over daily
- Only keep the last 5 log files

Thanks in Advance,
DM


		
___________________________________________________________ 
Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html

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


Re: maxBackupIndex with DailyRollingFileAppender

Posted by Curt Arnold <ca...@apache.org>.
On Mar 1, 2007, at 10:04 AM, James Stauffer wrote:

> In 1.2 no, but I think that is supported in 1.3.  In 1.2 you could set
> up a cron job to delete the extra files.
>

If has been a frequently requested feature, but definitely non- 
obvious to implement on top of the existing org.apache.log4j.DRFA  
since the user-specified date pattern makes it difficult to determine  
the corresponding date from the file name when the pattern omitted  
significant parts of the date and to determine the minimum number of  
intervals that would result in an arbitrary file name.

I started some work on a MultiFileAppender and this scenario was one  
of its use cases, but the work stalled around ApacheCON and before  
there was anything usable.  I hope to get back to it.










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


Re: maxBackupIndex with DailyRollingFileAppender

Posted by James Stauffer <st...@gmail.com>.
In 1.2 no, but I think that is supported in 1.3.  In 1.2 you could set
up a cron job to delete the extra files.

On 3/1/07, DM <do...@yahoo.co.uk> wrote:
> Hi,
>
> When using a DailyRollingFileAppender, is there any way to specify the maximum number of files which should be kept? I know that the RollingFileAppender supports a maxBackupIndex property, but it seems this is not supported by DailyRollingFileAppender. I don't want to use RollingFileAppender because I want the files to rollover every day, rather than when they reach a certain size. So my requirements are:
>
> - Roll files over daily
> - Only keep the last 5 log files
>
> Thanks in Advance,
> DM
>
>
>
> ___________________________________________________________
> Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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