logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marshall Powers" <mpow...@appsecinc.com>
Subject RE: rollingfileappender ... not rolling?
Date Tue, 17 Apr 2007 18:21:36 GMT
Ok I found the problem. It had nothing to do with log4cxx after all, its
just that the initialization code for the logger set the default max file
size with a value measured in kilobytes, which was later overwritten by a
value from the config file measured in bytes. So if I had had the patience
to wait for my "100kb" logs to grow to 100mb, I would have seen the correct
behavior of the rollingfileappender after all.

 

 

Sorry for the confusion,

 

Marshall

 

  _____  

From: log4cxx-user-return-1941-mpowers=appsecinc.com@logging.apache.org
[mailto:log4cxx-user-return-1941-mpowers=appsecinc.com@logging.apache.org]
On Behalf Of Curt Arnold
Sent: 2007-Apr-17 Tue 1:36 PM
To: Log4CXX User
Subject: Re: rollingfileappender ... not rolling?

 

 

On Apr 17, 2007, at 11:15 AM, Marshall Powers wrote:





I tried running the unit tests, as you suggested, and they appeared to work
fine. For kicks, I tried reducing the max file size of my
SizeBasedTriggeringPolicy to 100 bytes, as in the test case. What I saw was
when my application started, it quickly generated several log files of 100
bytes like foo.0.log, foo.1.log, etc, but at some point the TriggeringPolicy
stopped working, leaving me with a foo.0.log file of about 50kb and growing.
Do you think this confirms the weird file-size reporting problem you were
talking about before?

Thanks,

Marshall





Doesn't sound like the file-size reporting problem or it wouldn't hit the
byte counts. I'm guessing that the triggering policy is still requesting
rollovers, it is just that the FixedWindowRollingPolicy is failing to delete
the oldest log file and is abandoning the attempted rollover. The number of
retained rollovered files is 7 (with an max of 12) once those are filled up,
the oldest is deleted (line 233 of fixedwindowrollingpolicy) so the rest can
be renamed. In your experiment did you get 7 rollovered files? Are you able
to delete the oldest? I don't think there is a unit test that checks the
behavior once you start hitting the max number of files (I'll have to
check).

 

 

 


Mime
View raw message