Formatting trace output

前端 未结 7 1008
南笙
南笙 2020-12-29 09:14

I\'m using TextWriterTraceListener to log diagnostics messages to a text file. However I wan\'t also to log a timestamp of every trace message added. Is it poss

7条回答
  •  萌比男神i
    2020-12-29 09:47

    I recently encountered similar situation and it looks like now we have a tool very much fit for the task, namely Essential Diagnostics. You set up a listener in app.config like in code below and then just place Essential.Diagnostics.dll into the same folder. NO RECOMPILING IS REQUIRED. You can use this with any applications that uses System.Diagnostics for tracing, even if you do not own the source. Isn't that marvelous?

    
      
    
    

提交回复
热议问题