Welcome to MSDN Blogs Sign in | Join | Help

Debugging WCF - Traces and Message Logs

There has been enough posts on this topic. But this topic cannot be over emphasized. The best way to debug any WCF issue is to get a complete Message log and trace. We write tons of information to the trace that there is very little (if any) issues that traces cannot solve. Below is a config to generate Message logs and Traces in the Verbose level. The config will create a file e2eTraceTest.e2e in the directory where the config lives.

<configuration>
         <system.serviceModel>
                 <diagnostics>
                         <messageLogging maxMessagesToLog="30000" 
                                 logEntireMessage="true" 
                                 logMessagesAtServiceLevel="true" 
                                 logMalformedMessages="true" 
                                 logMessagesAtTransportLevel="true">
                         </messageLogging>
                 </diagnostics>
         </system.serviceModel>
         <system.diagnostics>
                 <sources>
                         <source name="System.ServiceModel" 
                                 switchValue="Verbose, ActivityTracing" 
                                 propagateActivity="true" >
                                 <listeners>
                                         <add name="xml" />
                                 </listeners>
                         </source>
                         <source name="System.ServiceModel.MessageLogging" 
                                 switchValue="Verbose">
                                 <listeners>
                                         <add name="xml" />
                                 </listeners>
                         </source>
                 </sources>
                 <sharedListeners>
                         <add name="xml" 
                              type="System.Diagnostics.XmlWriterTraceListener" 
                              initializeData="e2eTraceTest.e2e" />
                 </sharedListeners>
                 <trace autoflush="true" />
         </system.diagnostics>
 </configuration>
Published Wednesday, November 01, 2006 11:40 PM by govindr
Filed under: , ,

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

# links for 2006-11-02 &laquo; dstelow notes&#8230;

Thursday, November 02, 2006 6:38 PM by links for 2006-11-02 « dstelow notes…

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker