How to turn on WCF tracing at the client side?

人盡茶涼 提交于 2019-12-02 01:42:48

问题


I want to use the WCF tracing feature. Here I found a help to turn on the WCF tracing at the service side.

Now I want to enable the WCF tracing feature at the client side for a WCF service that I can consume only.


回答1:


Check this link for enabling the trace on client side: http://social.msdn.microsoft.com/Forums/vstudio/en-US/908f7f5a-a166-42c6-b323-aebd06576e0a/how-to-log-or-trace-message-at-wcf-client-side




回答2:


It's the same as the server side : add this section in your client's config file (web or app) :

<configuration>
  <system.di​agnostics​>
    <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "C:\LogFolder\LogFile.svclog" />
        </listeners>
      </source>
    </sources>
    <trace autoflush="true" />
  </system.diagnostics>
</configuration>


来源:https://stackoverflow.com/questions/17591169/how-to-turn-on-wcf-tracing-at-the-client-side

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!