Objective
As WCF is more and more applied to the actual system, its advantages are increasingly accepted by everyone. However, as a typical distributed application, WCF also has the inherent disadvantage of distributed application, that is, development and maintenance are relatively complex. Especially in the area of troubleshooting, it is much more complicated than the non-distributed program. So how can you more effectively troubleshoot the errors that occur in WCF? This will have to refer to the WCF trace log feature. This article will talk about the application of trace log in the example of a WCF service with IIS 6.0 as host.
Before you start, get acquainted with two friends: SvcConfigEditor and Svctraceviewer.
"SvcConfigEditor": A tool provided by Microsoft to assist in editing WCF configuration files. (You can, of course, edit the config file directly, but it's easier with the tools.) )
"Svctraceviewer": A tool provided by Microsoft to view the WCF trace log.
All two of their paths are C:\Program Files\Microsoft Sdks\windows\v6.0a\bin.
Configure config file to enable trace Log
Starting SvcConfigEditor.exe, you can see the following interface:
Open the Config file you want to edit by using File-> open-> config files. (web. Config file), select the Diagnostics node and display the following: