Skip to content

Latest commit

 

History

History
99 lines (75 loc) · 3.87 KB

Integration.md

File metadata and controls

99 lines (75 loc) · 3.87 KB

Home | Index | Examples | Guidance | FAQ | Listeners | Filters | Extensions

Integration

System.Diagnostics is already integrated with many parts of the .NET Framework, so you can include framework tracing within your application tracing.

System Defined Sources Summary

See below for details

Source Description
CardSpace Tracing for CardSpace.
System.IdentityModel Good for debugging Windows Identity Foundation. Old source was Microsoft.IdentityModel.
System.IO.Log Logging for the .NET Framework interface to the Common Log File System (CLFS).
System.Net Network operations, good for debugging connection problems, e.g. email sending.
System.Net.Sockets More detailed network operations.
System.Runtime.Serialization Logs when objects are read or written.
System.ServiceModel Logs all stages of WCF processin. Important to include the ActivityTracing for cross-tier correlation and set propagateActivity.
System.ServiceModel.Activation WCF tracing.
System.ServiceModel.MessageLogging WCF detailed message dumps; needs to also be turned on in WCF settings (see example).

Example Config

Example config sections, listing the sources only (but not configured with any listeners), plus the additional settings needed for WCF tracing.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.diagnostics>
    <!-- Also need to define listeners and link to the sources; can use the same listeners as your own code -->
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <clear />
        </listeners>
      </source>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
          <clear />
        </listeners>
      </source>
      <source name="Microsoft.IdentityModel" switchValue="Off" />
      <source name="CardSpace" switchValue="Off" />
      <source name="System.IO.Log" switchValue="Off" />
      <source name="System.Net" switchValue="Off" />
      <source name="System.Net.Sockets" switchValue="Off" />
      <source name="System.Runtime.Serialization" switchValue="Off" />
    </sources>
  </system.diagnostics>
  <system.serviceModel>
    <diagnostics>
      <messageLogging
           logEntireMessage="true"
           logMalformedMessages="false"
           logMessagesAtServiceLevel="true"
           logMessagesAtTransportLevel="false"
           maxMessagesToLog="3000"
           maxSizeOfMessageToLog="2000">
      </messageLogging>
    </diagnostics>
  </system.serviceModel>
</configuration>

Detail And References

Windows Communication Foundation (WCF)

WCF supports tracing, including correlated tracing across multiple tiers using the Service Trace Viewer.

See:

Windows Identity Foundation (WIF)

Tracing can be turned on to troubleshoot WIF federated sign on issues.

See:

System.Net.Mail

For an example of the switches to turn on the trace System.Net.Mail SMTP messages.

See:

Other

There are also other sources defined for areas such as System.Runtime.Serialization.