Elmah.Contrib.Mvc was designed to add ease-of-use to Elmah inside ASP.NET MVC projects
To install Elmah.Contrib.Mvc, run the following command in the Package Manager Console
PM> Install-Package Elmah.Contrib.Mvc
Use the ElmahHandleErrorAttribute
to decorate your actions, controllers, or configuration. it will try to use error signaling from ELMAH first, which involves the fully configured pipeline like logging, mailing, filtering and what have you. Failing that, it attempts to see whether the error should be filtered. If not, the error is simply logged. This implementation does not handle mail notifications. If the exception can be signaled then a mail will be sent if configured to do so.
Read this thread on Stack Overflow: how to get ELMAH to work with ASP.NET MVC [HandleError] attribute?
- Version 2.1: Restored support for .NET 4.0 and ASP.NET 4.0
- Version 2.0: Updated for ASP.NET MVC 5.0 and Elmah Core library
Fabian Vilers
Twitter: @fvilers