Exception Logging for WCF Services using ELMAH

前端 未结 6 861
暗喜
暗喜 2020-11-30 18:07

We are using the excellent ELMAH to deal with unhandled exceptions in an ASP.NET 3.5 web application. This works extremely well for all of the site apart from WCF services w

6条回答
  •  既然无缘
    2020-11-30 18:35

    I have done this based on Will's work but I want to verify that this is the correct approach before posting the code.

    I think this is a great approach (kudos to Will for this posting!). I don't think Will or you have missed anything here. Implementing IErrorHandler is the preferred way of capturing all possible server-side exceptions that could otherwise cause the communication channel to be faulted (torn down) and thus it's a natural place to hook in some logging like ELMAH.

    Marc

提交回复
热议问题