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

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 they occur.

As I am guessing its because ELMAH only logs unhandled errors and the [HandleError] attribute is handling the error so thus no need to log it.

How do I modify or how would I go about modifying the attribute so ELMAH can know that there was an error and log it..

Edit: Let me make sure everyone understands, I know I can modify the attribute thats not the question I’m asking… ELMAH gets bypassed when using the handleerror attribute meaning it won’t see that there was an error because it was handled already by the attribute… What I am asking is there a way to make ELMAH see the error and log it even though the attribute handled it…I searched around and don’t see any methods to call to force it to log the error….

8 s
8

Leave a Comment