将 WCF 请求记录到数据库 [英] Logging WCF Request to Database
问题描述
我想将我的 WCF 服务项目中的每个请求 xml 消息记录到数据库中.请建议我哪种方法是最好的和首选的方法.
I want to log every request xml message in my WCF service project to database. Please suggest me which is the best and preferred approach.
1) 使用 idispatchmessageinspector 接口
1) Using idispatchmessageinspector interface
或
2) 编写自定义 SQL 数据库跟踪侦听器?
2) writing Custom SQL database trace listener?
推荐答案
您必须编写自定义 WCF 跟踪侦听器.
You would have to write a custom WCF Trace Listener.
在这里寻求帮助:http://www.enusbaum.com/blog/2007/05/19/creating-a-custom-listener-for-your-wcf-application-in-c/ 和 http://weblogs.thinktecture.com/cweyer/2009/06/custom-tracelistener-writing-trace-messages-to-the-net-services-service-bus.html
Look here for some help: http://www.enusbaum.com/blog/2007/05/19/creating-a-custom-listener-for-your-wcf-application-in-c/ and http://weblogs.thinktecture.com/cweyer/2009/06/custom-tracelistener-writing-trace-messages-to-the-net-services-service-bus.html
这篇关于将 WCF 请求记录到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!