Welcome to MSDN Blogs Sign in | Join | Help

MADHU@MICROSOFT BLOG

All About Distributed apps

Syndication

News

Madhu Ponduru works at Microsoft. Everything here, though, is his personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.
How to enable WCF tracing

How to enable WCF trace:

Open config file in svcconfigeditor, from wizard, you can enable tracing and logging

STEP1:

Open config file in svcconfigeditor

STEP2:

Select Diagnostics option on left side, you will see Different tracing options on right side

STEP3:

  1. If you just want to log soap request and response, you can choose Message Tracing
  2. If you want trace service creation and all other activities, you can enable service tracing

Once you choose one of those options, you can choose, what level of tracing you want

(Like Verbose, or you want trace only error messages)

STEP4:

Click on Message Tracing, you will see different Message logging options, you can choose, you want to log Message at Transport level or Service level.

Reference:

http://windowssdk.msdn.microsoft.com/library/en-us/wcf_tools/html/2db21a57-5f64-426f-89df-fb0dc2d2def5.asp?frame=true

Ok, Now I got trace file, How to view trace file:

Once you have log file, you can open client side trace and service side trace file in svctraceviewer and you can filter trace by different categories

http://windowssdk.msdn.microsoft.com/en-us/library/ms732023.aspx

 

Tracing and Logging Sample

http://windowssdk.msdn.microsoft.com/library/en-us/WCF_samples/html/a4f39bfc-3c5e-4d51-a312-71c5c3ce0afd.asp?frame=true

http://windowssdk.msdn.microsoft.com/library/en-us/WCF_samples/html/4c4058ae-17ca-4994-80f5-1a8b51840754.asp?frame=true

MORE INFO ABOUT WMI AND PERF COUNTERS:

http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref20/html/P_System_ServiceModel_Configuration_DiagnosticSection_WmiProviderEnabled.asp
 
http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref20/html/P_System_ServiceModel_Configuration_DiagnosticSection_MessageLogging.asp
 
http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref20/html/P_System_ServiceModel_Configuration_DiagnosticSection_PerformanceCountersEnabled.asp


 

MORE INFO:

 The Diagnostics tab enables you to turn performance counters on or off, enable or disable Windows Management Instrumentation (WMI), configure WCF tracing, and configure Windows Communication Foundation (WCF) message logging.

To control performance counters and WMI

  1. Click the Diagnostics tab.

  2. To turn on WCF performance counters, select the Enable Performance Counters check box. Clear the box to turn off the counters.

  3. To turn on WMI, select the Enable WMI check box. Clear the box to disable WMI.

Configuring Tracing

You can create a WCF trace file with standard properties or set up a custom trace file.

To create a trace file with standard properties
  1. Click the Diagnostics tab and click Tracing.

  2. In the Diagnostics Tracing window that opens, click Create.

  3. Choose a location for the trace file, and click Save.

  4. Click OK to return to the Service Configuration Editor window.

To create a custom WCF trace file, you must configure both a source and listener.

To create a custom WCF trace file
  1. Click the Diagnostics tab, and then click Tracing.

  2. In the Diagnostics Tracing window that opens, on the Listeners tab, click Add.

  3. Enter the parameters for your trace file. Clicking the TypeName line displays a "" button. Click the "" button to open Trace Listener Type Browser, which you can use to find preconfigured trace listeners that are already installed.

  4. Note the Source section. Click Add in this section to open a dialog box with a drop-down menu listing available tracing sources. Select a tracing source and click OK.

  5. To apply your changes, click OK on each window until you return to the main Service Configuration Editor window.

Configuring Message Logging

You can create a WCF message logging file with standard properties or set up a custom logging file.

To create a message logging file with standard properties
  1. Click the Diagnostics tab and click Logging.

  2. In the Message Logging Editor window that opens, click the Create button.

  3. Choose a location for the log file and click Save.

  4. Click OK to return to the Service Configuration Editor window.

To create a custom WCF message logging file, you must configure a source and a listener, as well as certain parameters.

To create a custom WCF message logging file
  1. Click the Diagnostics tab and click Logging.

  2. In the Message Logging Editor window that opens, on the Listeners tab, click Add.

  3. Enter the parameters for your trace file. Clicking the TypeName line displays a "" button. Click the "" button to open the Trace Listener Type Browser, which you can use to find preconfigured trace listeners that are already installed.

  4. Note the Source section. Click Add in this section to open a dialog box with a drop-down menu listing available tracing sources. Select a tracing source and click OK.

  5. Click the Logging tab to set logging parameters. For example, you might want to set LogEntireMessage to False to help manage the size of log files.

  6. To apply your changes, click OK on each window until you return to the main Service Configuration Editor window.

Published Thursday, May 18, 2006 5:48 PM by madhu_ponduru@hotmail.com

Filed under:

Attachment(s): Basicsample.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Microsoft to issue patch to fix Windows glitch affecting some -- sensepages.com @ Thursday, May 18, 2006 11:46 PM

PingBack from http://blog.sensepages.com/?p=72

Microsoft to issue patch to fix Windows glitch affecting some -- sensepages.com

# Sony 2006: 601 Reasons They'll FailMicrosoft has added its own -- sensepages.com @ Friday, May 19, 2006 12:17 AM

PingBack from http://blog.sensepages.com/sony-2006-601-reasons-theyll-failmicrosoft-has-added-its-own/

Sony 2006: 601 Reasons They'll FailMicrosoft has added its own -- sensepages.com

# Living in a World of Connected Systems - Tracing in WCF @ Friday, May 19, 2006 4:54 AM

PingBack from http://www.marcmercuri.com/PermaLink.aspx?guid=52185e87-77de-4b5c-b675-0d9fe94005d1

Living in a World of Connected Systems - Tracing in WCF

# Custom Trace Listener sample @ Monday, June 26, 2006 10:48 AM

You can write your own customer trace listener and add this listener info to WCF application configuration...

MADHU BLOG : Windows Communication Foundation

# Tracing in WCF @ Thursday, July 06, 2006 1:59 PM

Living in a World of Connected Systems

# Troubleshooting WCF @ Thursday, September 07, 2006 2:23 PM

I had a problem with a WCF service that I created in that I couldn't access the Metadata Exchange (MEX)

Bryant Likes's Blog

# SOAP Message Logging in Metro and WCF @ Wednesday, August 01, 2007 2:14 PM

Metro provides Secure, Reliable, Transactional and .NET 3.0 interoperable Web services stack in GlassFish. This entry explains how to enable SOAP message logging in Metro and .NET 3.0. The SOAP message logging in Metro is explained here. In WCF (the..

Arun Gupta's Blog

# kevin Mocha - WCF tricks @ Friday, August 29, 2008 12:38 AM

PingBack from http://blog.lulutech.com/PermaLink,guid,55a573ca-aebc-4ad0-8ead-a877c65095cc.aspx

kevin Mocha - WCF tricks

# kevin Mocha - WCF tricks @ Tuesday, September 02, 2008 1:48 PM

PingBack from http://blog.lulutech.com/PermaLink,guid,6431557d-cf92-407b-b049-b8a80710dc6f.aspx

kevin Mocha - WCF tricks

Leave a Comment

(required) 
required 
(required) 
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker