开发者

WCF logging and statistics [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

What is the best approach to log WCF services behaviour? For example, what operations were called, how lond did it take to complete one specific operation, input parameters and output result of the operation, operation name, who made the request (client IP address) and etc.开发者_StackOverflow

I found that article http://msdn.microsoft.com/en-us/magazine/cc163302.aspx Is it good directions to move forward?

Thanks


Check WCF Tracing (MSDN), it can be quite excessive in terms of data produced, but I think you´ll be able to retrieve the informatin you´re looking for. Alternativly, If you´re hosting the service yourself, check AppFabric for Windows Server (MSDN) for higher comfort diagnostics.


You may also want to checkout (enable) the WCF performance counters. The advantage over tracing (obviously) is, that it does have much less overhead and depending on the particular setting ("All" vs. "ServiceOnly" - see link for details) is also suitable for production.

Additionally, you might want to checkout the WMI support of WCF.

Finally - as you have already discovered - , you could extend WCF, e.g. implementing a "Message Inspector" and use that for logging/recording request duration (see here for a starting point - basically you "measure" request begin/end with using the AfterReceiveRequest and BeforeSendReply overrides).

Depending on your needs and actual implementation thereof, the last option has (a) the smallest footprint, (b) greatest flexibility but (c) requires you to write some code whereas the others are, well, "standardized" and work for any WCF service provide you can change its configuration.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜