开发者

Diagnostics Trace: how to trace only one WCF endpoint

开发者 https://www.devze.com 2023-01-01 10:28 出处:网络
I have a WCF client that connects to multiple endpoints; some net.pipe, some https. The net.pipe endpoints have a fair amount of开发者_如何学C chatter but they work reliably, so I don\'t want to tra

I have a WCF client that connects to multiple endpoints; some net.pipe, some https.

The net.pipe endpoints have a fair amount of开发者_如何学C 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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消