Question

In all my applications, I have always set

<trace autoflush="true" />

Is there any reason why someone would want not to do that?

I guess there is a performance impact, but how big is it?

Was it helpful?

Solution

From the docs:

Trace.AutoFlush Property

Gets or sets whether Flush should be called on the Listeners after every write.

For performance reasons, you might prefer flushing less frequently (less IO). The downside of this is, lines that are not flushed will be lost in case of a crash.

Edit: The impact will be proportional to how frequent the trace is written to. If you aren't making a heavy use of it, the performance gain will possibly be ignorable. However, it is generally used in the whole codebase. Measuring is always better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top