You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicko Cadell <ni...@neoworks.com> on 2004/04/23 18:52:56 UTC

RE: RollingFileAppender - How does one specify TopOfWeek RollPoin t with a datepattern?

Josh,

I was wondering when someone would ask that.
This functionality is based on the log4j implementation. The
RollingFileAppender uses a very 'clever' system to detect the resolution of
the DatePattern specified. It does this in the ComputeCheckPeriod method.
The problem is that it uses the DateTime.ToString() to render the pattern to
a string. Therefore the only valid patterns are those supported by the
DateTime class. If the DateTime class had a pattern that was the week number
then you could specify that and ComputeCheckPeriod would pick TopOfWeek.
Unless there is a 'week' pattern that I don't know about it is not possible
to specify weekly rolling at the moment.

Nicko 

> -----Original Message-----
> From: Josh Jacob [mailto:josh.jacob@hansoninc.com] 
> Sent: 23 April 2004 17:11
> To: log4net-user@logging.apache.org
> Subject: Q: RollingFileAppender - How does one specify 
> TopOfWeek RollPoint with a datepattern?
> 
> 
> 	I was hoping to get a rolling log file on a weekly 
> schedule. I noticed that there is a RollPoint enumeration 
> with a TopOfWeek member but I'm not sure how to specify a 
> weekly datapattern.
> 
> 	Any advice on how to do this?
> 
> 	Thanks in advanced. Kudos to all the developers, 
> log4net has been a joy to work with!
> 
> 
> 
> 
> - josh jacob
>