.netWCF

Tracing and Logging in WCF(Part-8)

You can use Microsoft service Configuration Editor to enable tracing and message logging in WCF.

You can enable it in 2 ways.

  • Right click on web.config–>Edit WCF Configuration
  • Go to Tools in Visual studio–>WCF Service Configuration Editor–>File–>open–>open the required config file from local machine

After the tool is open, here is the steps to enable Logging.

  • Go to Diagonostics
    • Enable Log Auto Flush
    • Enable Message Logging
    • Enable Tracing
  • In Diagonostics–>Message Logging–>LogEntireMessage–>True
  • Close the tool and it would ask you to Save changes. Please save your changes

So now if you will go to web.config file, you will see below code snippet got added.

Then if you will run the host and test the clinet, then the log file and message file will get updated. You can check it in client project folder.you will see 2 files.web_messages and web_tracelog files.

You can view these logfiles by using below steps.

    Visula studio–>Microsoft windows sdk tool–>Service Trace viewer
    Visual studio command promopt–>SVCTraceViewer

© 2015, www.techkatak.com. All rights reserved.

One thought on “Tracing and Logging in WCF(Part-8)

Comments are closed.