【发布时间】:2016-11-06 21:32:45
【问题描述】:
我正在为我的 WPF 应用程序提供 WCF 服务。我希望监控从客户端应用程序收到的所有呼叫。
我阅读了一篇关于 WCF 跟踪的文章 http://dotnetmentors.com/how-to-enable-wcf-tracing-and-wcf-message-loging.aspx。
我在 WCF Web.Config 中使用了相同的代码
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="All"
propagateActivity="true">
<listeners>
<add name="messages"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="d:\logs\messages.svclog" />
</listeners>
</source>
</sources>
<trace autoflush="false" />
</system.diagnostics>
但我无法在上述位置创建任何文件d:\logs\messages.svclog。
请帮助我如何获取日志文件。
【问题讨论】:
标签: c# wcf logging wcf-data-services system.diagnostics