WCF Service: How to find server logs to understand error?

前端 未结 2 627
渐次进展
渐次进展 2021-01-11 11:03

I know this is probably a pretty basic question but I am brand new to WCF and Service creation. I am running a local hosted WCF service using Microsoft VS 2010 C#4. I am try

2条回答
  •  天涯浪人
    2021-01-11 11:22

    Logging is not necessarily turned on. Tracing and logging need to be enabled in WCF configuration (app.config or web.config). You can do this manually, or by clicking app.config and then selecting Edit WCF Configuration. If this item doesnt appear in context menu (happens in old versions of VS), you can find it in VS Tools menu or by running it manually (SvcConfigEditor.exe).

    By default, messages are logged to files in directory from which application is ran. You can edit this in configuration editor once you enable logging. Editor will allow you to specify file path once you enable logging or tracing.

    WCF Configuration Editor

    You can later use Microsoft Service Trace Viewer tool for going through the files, as large XMLs and are not user friendly. Viewer tool should come up itself once you double click log files, or you can run it manually (SvcTraceViewer.exe).

    enter image description here

提交回复
热议问题