none
WCF Tracing / SwitchValue RRS feed

  • Question

  • I enabled tracing and for some reason I am unable to restrict the traces only to Warning or above -- it logs all the messages. Below is my web.config snippets, could you please let me know what I am missing.

    <source propagateActivity="true" name="System.ServiceModel" switchValue="Warning, ActivityTracing">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
              <add name="ServiceModelTraceListener">
                <filter type="" />
              </add>
            </listeners>
          </source>

    <add initializeData="web_tracelog.svclog"
            type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
            <filter type="" />
          </add>

    Any Pointers?
    Wednesday, November 20, 2013 9:20 PM

Answers

  • Hi,

    We cannot use the propagateActivity attribute with user-defined trace sources. For user code activity ID propagation, make sure we do not set ServiceModel ActivityTracing, while still having ServiceModel propagateActivity attribute set to true.

    Please try to check the following to see if it help:

    <system.diagnostics>
        <sources>
    <source name="System.ServiceModel" switchValue="Warning, ActivityTracing">
    ...

    </source>
    </sources>
    </system.diagnostics>

    If the above can not work, please try to check the following:

    <system.diagnostics>
        <sources>
          <source name="System.ServiceModel" switchValue="Warning" propagateActivity="true">
    
        ...
    
           </source>
        </sources>
    </system.diagnostics>
    

    For more information, please try to check the following article:
    #Configuring Tracing:
    http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx .

    Best Reards,
    Amy Peng



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by diffident Friday, November 22, 2013 12:41 AM
    Thursday, November 21, 2013 4:27 AM
    Moderator