logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ersek, Laszlo" <la...@caesar.elte.hu>
Subject docs bug? "rolling.RollingFileAppender" has no "MaxBackupIndex"
Date Thu, 27 May 2010 17:54:33 GMT

I'm trying to create a log4j config where rotation is triggered by file 
size, an rotation includes compression. Browsing the docs and the config 
DTD, my purpose seems achievable with rolling.RollingFileAppender + 
SizeBasedTriggeringPolicy + TimeBasedRollingPolicy. (The latter is only 
needed because it seems to be the only rolling policy that supports 
compression out of the box.)

Hence I created a config file for the DOM configurator. In fact, I'm 
converting an older config file which was written for the property 
configurator. The old configuration used the original (not extras) 
RollingFileAppender. I'm having trouble converting the MaxBackupIndex 
property of that older class. Any MaxBackupIndex seem to make no sense for 
the new rolling.RollingFileAppender, since that one requires an explicit 
rolling policy.

My problem is that the API docs do talk about MaxBackupIndex, in the 
description of rollover():


I downloaded apache-log4j-extras-1.0.tar.gz and tried to look at the code 
(src/main/java/org/apache/log4j/rolling/RollingFileAppender.java). It 
appears to me that the class has indeed no business with any 
MaxBackupIndex -- the only mentions are in the leading comment of 
rollover() (which is probably the source of the javadoc occurrences too).

I checked the bugzilla with "Product: Log4j, Summary: maxbackupindex", and 
it only returned #24407, which is irrelevant here ("large maxbackupindex 
makes RollingFileAppender dread slow").

So is this a documentation bug?

... Furthermore, now that I'm looking at the source of 
FixedWindowRollingPolicy, it does seem to support gzip compression. Its 
description doesn't mention it though (while that of its sibling class 
TimeBasedRollingPolicy does):


so I think people are led to believe that only TimeBasedRollingPolicy 
supports compression. Is this another documentation bug?

In closing, thank you very much for this great software!


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

View raw message