logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dale King" <dalewk...@gmail.com>
Subject Re: Problem using RollingFileAppender
Date Fri, 16 May 2008 13:25:34 GMT
It's designed that way. Since you are using a properties file I assume
you are using the RollingFileAppender as opposed to the
rolling.RollingFileAppender. The latter is a better replacement that
is more generic, but it can't be configured from a properties file.

This more generic one uses a RollingPolicy and TriggeringPolicy. The
one that you are using is implemented using  the more generic one
(it's actually a subclss). In the documentation for its
FixedWindowRollingPolicy which is what does the renaming, at
http://logging.apache.org/log4cxx/apidocs/index.html it contains this

"Given that this rollover algorithm requires as many file renaming
operations as the window size, large window sizes are discouraged. The
current implementation will automatically reduce the window size to 12
when larger values are specified by the user."

If you looked at the Log for Log4Cxx itself you should probably see a
message that says:

"Large window sizes are not allowed."

There currently is no way to override this maximum other than edit the
enum constant in FixedWindowRollingPolicy.

On Fri, May 16, 2008 at 5:54 AM, Zhao Qinghua <qinghua@ufinity.com> wrote:
> Hi,
> I have encountered a weird problem when using log4cxx's RollingFileAppender.
> In the log4j.properties file, if I assign MaxBackupIndex a value < 13, it
> will work properly, for example, if I set MaxBackupIndex = 5, it will
> correctly backup 5 log files. However, if I set it to a value > 13, the
> weird thing happens: it always backup exactly 13 log files no matter what
> value I set MaxBackupIndex to. Can anyone help me with this problem? Thanks
> a lot!
> Regards,
> Qinghua

Dale King

View raw message