RE: rolling by size/date

Nicko Cadell <[email protected]> Tue, 3 Feb 2004 12:10:22 -0000
Newsgroups gmane.comp.windows.dotnet.log4net.user
Message-ID <[email protected]>
Alex,

> Is it possible to roll by size and still have the date 
> specified in the DatePattern param of the 
> RollingLogFileAppender still appear as part of the filename ?  

Currently this is not possible.


> Another, related issue:
> I understand from the documentation that for the 
> RollingFileAppender The DatePattern property somehow 
> determines the policy of rolling, but I cannot understand 
> what the rule is. I need my file to roll every day at 
> midnight but how do I specify this ? The configuration below 
> seems to roll the file very very often. Is it because the 
> DatePattern param contains seconds ? What is the rule here ?

The date rolling period is calculated from the resolution of the date
pattern specified. If the date pattern only sees changes each day (e.g.
"yyyyMMdd") then the period will be daily. If the date pattern can see finer
changes then the period will be shorter, e.g. if the pattern is
"yyyyMMdd-HHmm" then the period will be one minute.

Your pattern "ddMMyyTHHmmSS" will have a rolling period of 1 second. This
will probably mean that you will get about one message per file and lots and
lots of files.

Nicko



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn