views:

34

answers:

1

is there a solution to make the log files be created each week by RollingFileAppender's datePattern? I know that yyyyMMdd is valid for each day but i couldn't find a solution for weekly logging. thanks in advance.

A: 

As far as I can tell you need to write your own appender for this. The .Net custom format strings do not have anything for getting the calendar week. There is an API for that though:

http://msdn.microsoft.com/en-us/library/system.globalization.calendar.getweekofyear%28VS.71%29.aspx

Stefan Egli
i read in here http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo%28VS.71%29.aspx that there was a formating like ddd which returns the week day. so i wrote yyyyMMddd and now i am waiting for the next week to see if it worked fortunately =)
cemregoksu
this returns something like "Mon" for "Monday", doesn't it?
Stefan Egli
Yes, it does i think... so it supposes the idea that it won't work? =)
cemregoksu
It will not work. You need to extend the appender or write your own.
Stefan Egli