TraceListener AutoFlush question

  • Thread starter Thread starter Tony!
  • Start date Start date
T

Tony!

I want to set my Tracelistener to auto flush.
in the code below, I don't have the option to do something like
tony.autoflush

Yet I see that setting for app.config files when googling for the
autoflush setting.. It's not available via actual code?

TextWriterTraceListener tony = new
TextWriterTraceListener("rrdTooltk.log");
tony.WriteLine("This is Text Log");
tony.Flush();



Thanks,

Tony!
 
Tony! said:
I want to set my Tracelistener to auto flush.
in the code below, I don't have the option to do something like
tony.autoflush

Yet I see that setting for app.config files when googling for the
autoflush setting.. It's not available via actual code?

TextWriterTraceListener tony = new
TextWriterTraceListener("rrdTooltk.log");
tony.WriteLine("This is Text Log");
tony.Flush();

AutoFlush is a static property of the Trace class:

System.Diagnostics.Trace.AutoFlush=true;

It will affect any TraceListener that you have added to the Listeners
collection.
 
Back
Top