Which XML segment should you add to the system.diagnostics configuration element in the client and server application configuration file?

You want to debug the Windows Communication Foundation (WCF) client and server interaction through message and application tracing.
You need to correlate traces generated on the client and the server.
Which XML segment should you add to the system.diagnostics configuration element in the client and server application configuration file?

You want to debug the Windows Communication Foundation (WCF) client and server interaction through message and application tracing.
You need to correlate traces generated on the client and the server.
Which XML segment should you add to the system.diagnostics configuration element in the client and server application configuration file?

A.
<sources>
<source propagateActivity=”true” name=”System.ServiceModel” switchValue=”Warning, ActivityTracing”>
<listeners>
<add name=”ServiceModelTraceListener” />
</listeners>
</source>
</sources>

B.
<sources>
<source name=”System.ServiceModel.MessageLogging” switchValue=”Verbose”>
<listeners>
<add name=”ServiceModelTraceListener” />
</listeners>
</source>
</sources>

C.
<sources>
<source name=”System.ServiceModel.MessageLogging” propagateActivity=”true” switchValue=”Warning, ActivityTracing”>
<listeners>
<add name=”ServiceModelTraceListener” />
</listeners>
</source>
</sources>

D.
<sources>
<source name=”System.ServiceModel” switchValue=”VerboseActivityTracing”>
<listeners>
<add namee”ServiceModelTraceListener” />
</listeners>
</source>
</sources>

Explanation:
Configuring Activity Tracing and Propagation for Correlation

The activityTracing value specified for the switchValue attribute is used to enable activity tracing,
which emits traces for activity boundaries and transfers within endpoints.

When you use certain extensibility features in WCF, you might get a NullReferenceException when activity tracing is enabled.
To fix this problem, check your application’s configuration file and ensure that the switchValue attribute for your trace source is not set to activityTracing.

The propagateActivity attribute indicates whether the activity should be propagated to other endpoints that participate in the message exchange.
By setting this value to true, you can take trace files generated by any two endpoints and observe how a set of traces on one endpoint flowed to a set of traces on another endpoint.

Both propagateActivity and ActivityTracing Boolean values apply to the System.ServiceModel TraceSource.
The ActivityTracing value also applies to any trace source, including WCF or user-defined ones.

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

Tracing and Message Logging
(http://msdn.microsoft.com/en-us/library/ms751526.aspx)

Configuring Tracing
(http://msdn.microsoft.com/en-us/library/ms733025.aspx)



Leave a Reply 1

Your email address will not be published. Required fields are marked *