Share via


Configuring Tracing in DCS Services and Client Applications

To configure tracing in a DCS service, define listeners for each of the event sources that you wish to trace. The following code sample shows the relevant sections of a configuration file for a DCS service. The configuration file captures information from the CIS and Microsoft.ConnectedIndustry.ServiceModel event sources. For more information about these event sources, see The DCS Tracing Infrastructure. For information on configuring event sources, see <system.diagnostics> Element.

<?xml version="1.0" encoding="utf=8"?>
<configuration>
    ...
    <system.diagnostics>
        <sources>
            <source name="CIS" switchValue="Error, Critical ">
                <listeners>
                    <add name="fileListener" ... />
                </listeners>
            </source>
            <source name="Microsoft.ConnectedIndustry.ServiceModel" switchValue="Error, Critical ">
                <listeners>
                    <add name="fileListener" ... />
                </listeners>
            </source>
        </sources>
    </system.diagnostics>
    ...
</configuration>

Note

You can capture trace information to any available trace listener class.

To configure client-side tracing, you can use the same CIS and Microsoft.ConnectedIndustry.ServiceModel event sources.

See Also

The DCS Tracing Infrastructure

<system.diagnostics> Element