Tuesday 15 January 2013

c# - I want to add the date to my log file -


If you log in to wcf calls and messages, then log files can be very big, very fast I log from date I want to split the file. I can write my own tracel Tellin, but if possible I like some stability in the log. Something like this

  & lt; Shared Editor & gt; & Lt; Add initilizeDate = "SomeLogFile {TODAY} .log"  

A log file output like this would be: SomeLogFile2009-12-01

How can I do this?

You can use your own trace aliasing or apply it. Log 4 has a rolling file adapter in the net, which actually does it (it can roll files according to date and / or size)


No comments:

Post a Comment