记录一个WCF服务超时(不SVC跟踪) [英] Logging a WCF service timeout (not to svc trace)

查看:115
本文介绍了记录一个WCF服务超时(不SVC跟踪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个自我托管接收并处理来自专有设备的请求WCF服务。性能测试过程中,我们才能看到接收太多的请求时,会发生什么淹没了服务。

We have a self hosted WCF service which receives and processes requests from proprietary devices. during a performance test we flooded the service in order to see what happens when too many requests are received.

我们发现,一些连接得到超时,这样很好。我们的问题是,我们希望它会记录在常规日志。 我们记录到事件日志。

We found out that some connections get timed out, and its alright. our problem is that we want it to be logged in the regular log. We are logging to the EventLog.

怎么能这样做?是否有某种OnTimeOut事件的地方,我们可以连接到?

How could this be done? is there some kind of a OnTimeOut event somewhere that we can hook up to?

推荐答案

以防万一,但似乎你知道这一点,这里是如何激活诊断(的 WCF跟踪)。

Just in case, but it seems you do know about this, here is how to activate diagnostics (WCF tracing).

在我看来,你便可以创建自己的跟踪侦听器,这在事件日志写?这里的困难是限制诊断只是你感兴趣的事件,但我想你可以,如果需要在监听器添加自己的过滤器。

Seems to me that you could then create your own trace listener, which write in the EventLog ? The difficulty here would be to limit the diag to just the event you are interested in, but I guess you could add your own filter in the listener if needed.

这篇关于记录一个WCF服务超时(不SVC跟踪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆