代码改变世界

WCF调试日志

2015-04-19 23:39  snys98  阅读(317)  评论(0编辑  收藏  举报

     WCF调试,打不了断点or远程调试时,在配置文件的<configuration>结点下面加一段,就可以在对应位置查看服务器调试日志了,远程调试完毕发送亦可!

 
<system.diagnostics>
<sources>
    <source name="System.ServiceModel" switchValue="Warning" propagateActivity="true">
    <listeners>
        <add name="xml" />
    </listeners>
    </source>
</sources>
<sharedListeners>
    <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="【路径】\wcf.svclog" />
</sharedListeners>
</system.diagnostics>

 

yeah~