开发者

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

开发者 https://www.devze.com 2023-04-02 19:19 出处:网络
Is there ther开发者_运维知识库e any simple way of getting a WCF Service to log SOAP requests and responses to a text file.

Is there ther开发者_运维知识库e any simple way of getting a WCF Service to log SOAP requests and responses to a text file.

I want to log the messages on server, just to clarify.


If you can change the service code to add a behavior, you can hook up an IDispatchMessageInspector and use whichever logging framework to log at the messages there. You can also look at the WCF Message Logging feature, which uses the System.Diagnostic framework to perform the logging (I haven't used log4net yet, maybe they have some trace listener which can be used for this as well).

0

精彩评论

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