views:

47

answers:

2

Log files can get very big, very fast if you log wcf calls and messages. I want to split up the log files by date. I can write my own tracelistener but i prefer some constant in the log if that is possible. Something like this

<sharedListener>
 <add initilizeDate="SomeLogFile{TODAY}.log"

this would output a log file like this : SomeLogFile2009-12-01

how do I do that?

A: 

Check this post, it might guide you in the right direction.

klausbyskov
Thx for your reply. I edited my post: I prefer some constant in the log if that is possible
MichaelD
+1  A: 

You can use Log4Net, or implement your own TraceListener. Log4Net has RollingFileAppender, which does exactly that (it can roll files by date and/or size)

RA
Thx for your reply. I edited my post: I prefer some constant in the log if that is possible
MichaelD
What do you mean by constant? That the log will be rolled each day and have the date in the filename?
RA