诊断跟踪:如何仅跟踪一个 WCF 端点
我有一个连接到多个端点的 WCF 客户端;一些 net.pipe,一些 https。
net.pipe 端点有相当多的干扰,但它们工作可靠,所以我不想跟踪这些端点,因为日志文件变得太大并且太快变得混乱。但是,https 端点相当新,我需要跟踪该端点。如何仅跟踪该端点,而不跟踪其他 net.pipe 端点?如果我必须跟踪所有 https 端点而不跟踪 net.pipe 端点,那也没关系,不过如果能够打开和关闭各个端点就更好了。另外,我希望有一个 all .config 选项(即,不编写我自己的跟踪侦听器)。
谢谢!
I have a WCF client that connects to multiple endpoints; some net.pipe, some https.
The net.pipe endpoints have a fair amount of chatter but they work reliably, so I don't want to trace those, as the log file gets too big and cluttered too quickly. However, the https endpoint is fairly new and I need to trace that one. How do I trace only that endpoint, and not the other net.pipe endpoints? It would be ok if I had to trace all https endpoints and no net.pipe endpoints, though it would be nice to be able to turn on and off individual end points. Also, I'm hoping for an all .config option (i.e., no writing of my own trace listener).
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在写入日志数据之前使用 xpath 表达式来过滤日志数据。请参阅此处 http://msdn.microsoft.com/en-us/library/邮件过滤器下的 ms730064.aspx。
您还可以将 xpath 表达式作为 FilterInitData 添加到 XmlWriterTraceListener。
You can use xpath expressions to filter logging data before it is written. See here http://msdn.microsoft.com/en-us/library/ms730064.aspx under Message Filters.
You can also add the xpath expression to the XmlWriterTraceListener as FilterInitData.