You must distinguish between MessageLogging and Tracing. Your sensitive data seems to be part of the message data. Therefore, when you turn on message logging, you will see your sensitive data in text form in your logs.
Tracing, on the other hand, is more related to WCF infrastructure events. The content of your posts will not be recorded there.
Also with exceptions thrown by the WCF runtime: they will never contain any message data. By default, exceptions provided to the client contain absolutely no information for security reasons. You must explicitly include the data that you want to send to the client in the event of an exception.
I'm not sure how to intercept logging and tracing, but WCF is certainly very extensible, so I'm sure there is an extension point to insert your TracingBehavior somewhere in the infrastructure.
source share