问题
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.diagnostics>
<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