locked
Flushing out Trace output RRS feed

  • Question

  • Hi,

    I am developing and testing a WCF service hosted in Windows Service (VS2008, WinXP Pro SP3, Framework 3.5). I am using TextWriterTraceListener to output debugging info to a text file. Here is my config setting:

    <system.diagnostics>
    <trace autoflush="false" indentsize="4">
    <listeners>
    <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\ServiceLog.txt"></add>
    <remove name="Default"></remove>
    </listeners>
    </trace>

    The problem I am having is that it is not writing to text file in realtime and keeps debugging data in the buffer until it is full. It does not flush out even if I stop the service. This is stopping me from debugging the service.

    Should I set autoflush="true" in config file? Are there any considerations in this regard? I vaguely remember reading about this switch that was not in favor of setting it on.

    Thanks.

    kr

     

    Thursday, September 30, 2010 9:24 PM

Answers

All replies