开发者

I want to add the date to my log file

开发者 https://www.devze.com 2022-12-13 02:48 出处:网络
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 l

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消