How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?

前端 未结 8 1971
后悔当初
后悔当初 2020-11-22 02:53

I am trying to use ELMAH to log errors in my ASP.NET MVC application, however when I use the [HandleError] attribute on my controllers ELMAH doesn\'t log any errors when the

8条回答
  •  遥遥无期
    2020-11-22 03:09

    You can take the code above and go one step further by introducing a custom controller factory that injects the HandleErrorWithElmah attribute into every controller.

    For more infomation check out my blog series on logging in MVC. The first article covers getting Elmah set up and running for MVC.

    There is a link to downloadable code at the end of the article. Hope that helps.

    http://dotnetdarren.wordpress.com/

提交回复
热议问题