locked
Trace Listeners RRS feed

  • Question

  • Hello,

    I am confused with Trace Listeners.

    Since we already have Tracewrite and Trace Switches etcs, we can write the diagnostic results to a trace file.

    My question is are the Trace Listeners superfluous?
    What are the purpose of them?

    Thanks.
    Monday, January 19, 2009 8:02 PM

Answers

  • Microsoft didn't try to guess what you might want to do with the trace output.  Maybe you want to send the last 100 trace lines in an email when something goes wrong.  With the TraceListener base class, you can do anything you like.  And change the listener without recompiling your code.
    Hans Passant.
    Monday, January 19, 2009 8:51 PM

All replies

  • Microsoft didn't try to guess what you might want to do with the trace output.  Maybe you want to send the last 100 trace lines in an email when something goes wrong.  With the TraceListener base class, you can do anything you like.  And change the listener without recompiling your code.
    Hans Passant.
    Monday, January 19, 2009 8:51 PM
  • I have a file which is Trace.txtaaa.vshost.exe.txt.


    What is that?
    Monday, January 19, 2009 9:14 PM