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: [email protected] Click here to experience the MIR3 demo > -----Original Message----- From: Curt Arnold [mailto:[email protected]] 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: [email protected] For additional commands, e-mail: [email protected] 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: [email protected] For additional commands, e-mail: [email protected]
