none
wcf message logging - how? RRS feed

  • Question

  • Hi,

    I try log messages on server side but When I check my trace viewer, message tab is always empty.

    here is my web.config set up regarding tracing. Can you please tell what I am missing there.

     <diagnostics>
          <messageLogging logEntireMessage="true" logMalformedMessages="true"
            logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
          <endToEndTracing activityTracing="true" />
        </diagnostics>
    
    
    
     <system.diagnostics>
        <sources>
          <source propagateActivity="true" name="System.ServiceModel" switchValue="Error,ActivityTracing">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
              <add name="xml">
                <filter type="" />
              </add>
            </listeners>
          </source>
          <source name="ServerCalculatorTraceSource" switchValue="Information,ActivityTracing">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
              <add name="xml">
                <filter type="" />
              </add>
            </listeners>
          </source>
          <source propagateActivity="false" name="System.ServiceModel.MessageLogging"
            switchValue="Error">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
          <add initializeData="C:\log\ServerTraces.svclog" type="System.Diagnostics.XmlWriterTraceListener"
            name="xml" traceOutputOptions="LogicalOperationStack, Timestamp, Callstack">
            <filter type="" />
          </add>
        </sharedListeners>
        <trace autoflush="true" />
      </system.diagnostics>


    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

    Friday, May 9, 2014 4:23 PM

Answers