0

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?

MichaelD
  • 8,377
  • 10
  • 42
  • 47

1 Answers1

1

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.
  • 1,405
  • 1
  • 11
  • 18
  • Thx for your reply. I edited my post: I prefer some constant in the log if that is possible – MichaelD Dec 01 '09 at 13:19
  • What do you mean by constant? That the log will be rolled each day and have the date in the filename? – RA. Dec 01 '09 at 13:28