logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: DatePatterns in RollingFileAppender
Date Wed, 17 Aug 2005 11:58:29 GMT
 

> -----Original Message-----
> From: Shaily Goel [mailto:gshaily@novell.com] 
> Sent: 17 August 2005 11:52
> To: log4net-user@logging.apache.org
> Subject: DatePatterns in RollingFileAppender
> 
> Hi
>  
> I am using RollingFileAppender to log the messages. The 
> RollingFileAppender should roll the files based on Date. For 
> this, I need to set "DatePattern" property of 
> RollingFileAppender. I am not able to find the correct 
> DatePatterns that should be used for following. Please give 
> me the examples that what date patterns should  I use for following:

The RollingFileAppender uses DateTime.ToString(pattern) to convert the
date to a string.
See http://msdn2.microsoft.com/library/8kb3ddd4(en-us,vs.80).aspx for
details of the pattern specifiers.


> 1.  Rollover at the beginning of each month 

yyyy-MM


> 2.  Rollover at the first day of each week. 
>     The first day of the week depends on the locale.

not possible, no date pattern for day of week


> 3.  Rollover at midnight each day

yyyy-MM-dd


> 4.  Rollover at midnight and midday of each day 

yyyy-MM-ddt


> 5.  Rollover at the top of every hour

yyyy-MM-dd-HH


> 6.  Rollover at the beginning of every minute

yyyy-MM-dd-HH-mm


>  
> Thanks
> Shaily
>  
>  
> 

Mime
View raw message