I don't see autoflush option on TraceSource like there is for Trace.
Is there a way to autoflush without having to flush manually after each write?
BTW I'm using TextWriterTraceListener as my trace source listener and not using config xml.
Internally TraceSource
uses AutoFlush
setting of Trace
class. E.g. sources of TraceSource.TraceEvent
method:
for (int j = 0; j < this.listeners.Count; j++)
{
TraceListener listener = this.listeners[j];
listener.TraceEvent(eventCache, this.Name, eventType, id, format, args);
if (Trace.AutoFlush)
{
listener.Flush();
}
}
So, all you need to do, is set Trace.AutoFlush
to true. BTW same is stated in MSDN:
The trace listeners use the values of the Trace class properties Indent, IndentSize, and AutoFlush to format trace output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With