WCF Trace log is only updating when service is stoped RRS feed

  • Question

  • Hi,

    We have WCF service hosted as windows service. We are using below code to enable trace of WCF messages. The problem which we face is the trace file is only updating when the windows service is stopped, Actually I need this updated immediately or at least after few minutes, is there anyway?

    Note: We hosted the service on Windows 7,  2003 server every where behavior is same.

                <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        <add name="ServiceModelMessageLoggingListener">
                            <filter type="" />
                <add initializeData="C:\log\messages.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
                    <filter type="" />
                <messageLogging logEntireMessage="true" logMalformedMessages="true"
                    logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />

    Thursday, November 19, 2015 5:32 AM


  • Hello Mujeeb_Rahiman,

    I have had this before and it was simply that autoflush was not on.  

        <trace autoflush="false" indentsize="3" />



    • Proposed as answer by Grady_Dong Friday, November 20, 2015 3:10 AM
    • Marked as answer by Mujeeb_Rahiman Tuesday, November 24, 2015 4:40 AM
    Thursday, November 19, 2015 6:55 PM