views:

132

answers:

1

Hi, 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!

A: 

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.

Huusom