Log soap and a response from a Wcf web service to a text file using log4net

Is there any simple way to get the WCF service to register SOAP requests and responses to a text file.

I want to log messages on the server to clarify.

+4
source share
1 answer

If you can change the utility code to add behavior, you can connect IDispatchMessageInspector and use any logging structure to log messages there. You can also see the WCF message logging function , which uses the System.Diagnostic system to do the logging (I have not used log4net yet, maybe they have some trace listener that can also be used for this).

+5
source

All Articles