> -----Original Message----- > From: Shaily Goel [mailto:[EMAIL PROTECTED] > Sent: 17 August 2005 11:52 > To: [email protected] > 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 > > >
