I want to add the date to my log file
Log files can get very big, very fast if you log wcf calls and messages. I want to split up the log files b开发者_如何学JAVAy 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?
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)
精彩评论