Re: Question about using org.apache.log4j.rolling.RollingFileAppender
Simon Park <simon_park_mail <at> yahoo.co.uk>
2010-04-02 08:00:38 GMT
The TimeAndSizeRollingApender doesn't bother renaming the list of backup files and so doesn't have this
restriction. It's freely available under the same Apache 2.0 license as Log4J at www.simonsite.org.uk.
________________________________
From: Doal Miller <Doal.Miller <at> mir3.com>
To: Log4J Users List <log4j-user <at> logging.apache.org>
Sent: Tue, 16 March, 2010 16:05:44
Subject: RE: Question about using org.apache.log4j.rolling.RollingFileAppender
Thanks for the reply. I can probably get away with using TimeBasedRollingPolicy. If not maybe I'll look
into the work you proposed. Thanks.
Doal Miller
Sr. Software Engineer
Real-Time Universal Notification & Response Technology(tm)
Direct: 858.724.1278
Cell: 760.613.6960
Email: doal.miller <at> mir3.com
Click here to experience the MIR3 demo >
-----Original Message-----
From: Curt Arnold [mailto:curt.arnld <at> gmail.com] On Behalf Of Curt Arnold
Sent: Monday, March 15, 2010 8:27 PM
To: Log4J Users List
Subject: Re: Question about using org.apache.log4j.rolling.RollingFileAppender
On Mar 15, 2010, at 6:48 PM, Doal Miller wrote:
> I've been playing around with the RollingFileAppender out of the extra jar and I've gotten it working in a
couple of different ways but I'm not getting exactly what I want.
>
> What I want is to roll a file when the maximum size is reached and to keep a large number of files around, like
around 250. With my following configuration file it rolls at 10,000 bytes but the
FixedWindowRollingPolicy doesn't allow me to keep over 12 files. If I try to set MaxIndex higher than 12 it
complains and resets it. I tried using the TimeBasedRollingPolicy instead, in conjunction with
SizeBasedTriggeringPolicy but I guess TimeBasedRollingPolicy uses its own triggering policy.
>
> Is there a way to set the max number of files for the FixedWindowRollingPolicy to 250 without cracking open
the code?
>
> Thanks in advance for any suggestions.
>
The limit on maximum files was added since things get very slow if you rename 250 files one at a time (delete
.250, rename .249 to .250, rename .248 to .249, etc).
Renaming log files is inherently risky and platform dependent. Writing an RFA alternative using java.nio
and avoiding renames has been on my to-do list for a long time.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
For additional commands, e-mail: log4j-user-help <at> logging.apache.org
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.436 / Virus Database: 271.1.1/2745 - Release Date: 03/15/10 19:33:00
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
For additional commands, e-mail: log4j-user-help <at> logging.apache.org