web analytics
Using Service Trace Viewer to Diagnose WCF Service Options
codeling
Posted: Friday, March 4, 2016 8:51:27 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 916
Points: 3849

Windows Communication Foundation (WCF) Service Trace Viewer Tool (SvcTraceViewer.exe) helps you analyze diagnostic traces that are generated by WCF. Service Trace Viewer provides a way to easily merge, view, and filter trace messages in the log so that you can diagnose, repair, and verify WCF service issues.

 

Sponsor
Posted: Friday, March 4, 2016 8:51:27 AM
 
codeling
Posted: Friday, March 4, 2016 8:53:53 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 916
Points: 3849

Configuring Tracing

Diagnostic traces provide you with information that shows what is happening throughout your application's operation. As the name implies, you can follow operations from their source to destination and through intermediate points as well.

You can configure tracing using the application’s configuration file—either Web.config for Web-hosted applications, or Appname.config for self-hosted applications. The following is an example:

 

<system.diagnostics>
    <trace autoflush="true" />
    <sources>
            <source name="System.ServiceModel" 
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
            <listeners>
               <add name="sdt" 
                   type="System.Diagnostics.XmlWriterTraceListener" 
                   initializeData= "SdrConfigExample.e2e" />
            </listeners>
         </source>
    </sources>
</system.diagnostics>

In this example, the name and type of the trace listener is specified. The Listener is named sdt and the standard .NET Framework trace listener (System.Diagnostics.XmlWriterTraceListener) is added as the type. The initializeData attribute is used to set the name of the log file for that Listener to be SdrConfigExample.e2e. For the log file, you can substitute a fully-qualified path for a simple file name.

The example creates a file in the root directory called SdrConfigExample.e2e. When you use the Trace Viewer to open the file as described in the “Opening and Viewing WCF Trace Files” section, you can see all the messages that have been sent.

The tracing level is controlled by the switchValue setting. The available tracing levels are described in the following table.

Trace Level

Description

Critical

  • Logs Fail-Fast and Event Log entries, and trace correlation information. The following are some examples of when you might use the Critical level:

  • Your AppDomain went down because of an unhandled exception.

  • Your application fails to start.

  • The message that caused the failure originated from the process MyApp.exe.

Error

  • Logs all exceptions. You can use the Error level in the following situations:

  • Your code crashed because of an Invalid Cast Exception.

  • A "failed to create endpoint" exception is causing your application to fail on startup.

Warning

  • A condition exists that may subsequently result in an error or critical failure. You can use this level in the following situations:

  • The application is receiving more requests than its throttling settings allows.

  • The receiving queue is at 98 percent of its configured capacity.

Information

  • Messages helpful for monitoring and diagnosing system status, measuring performance, or profiling are generated. You can utilize such information for capacity planning and performance management. You can use this level in the following situations:

  • A failure occurred after the message reached the AppDomain and was deserialized.

  • A failure occurred while the HTTP binding was being created.

Verbose

  • Debug-level tracing for both user code and servicing. Set this level when:

  • You are not sure which method in your code was called when the failure occurred.

  • You have an incorrect endpoint configured and the service failed to start because the entry in the reservation store is locked.

ActivityTracing

Flow events between processing activities and components.

This level allows administrators and developers to correlate applications in the same application domain.

  • Traces for activity boundaries: start/stop.

  • Traces for transfers.

You can use add to specify the name and type of the trace listener you want to use. In the example configuration, the Listener is named sdt and the standard .NET Framework trace listener (System.Diagnostics.XmlWriterTraceListener) is added as the type. Use initializeData to set the name of the log file for that Listener. In addition, you can substitute a fully-qualified path for a simple file name.

Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2017 Digcode.com. All rights reserved.