I am trying to use ELMAH for my error logging, and I've tried several others
Neither of which seem to log errors when the custom error feature in ASP.NET is enabled
I'm using the [HandleError] attribute in all my controllers, at first I thought that was the problem but it isn't just whenever I enable the custom error pages it doesn't log any errors even though half these error logging libraries say they are suppose to.
What am I doing wrong?
-
Handle error only handles error thrown by actions, errors like invalid params for actions are not being handled by handleerror atribute, how do you log those messagesmamu– mamu2010年11月06日 19:34:13 +00:00Commented Nov 6, 2010 at 19:34
-
Possible duplicate of How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?cederlof– cederlof2016年04月20日 14:48:56 +00:00Commented Apr 20, 2016 at 14:48
2 Answers 2
A couple things to check are that you have your HttpModule registered for ELMAH. You don't have any other process intercepting the errors.
4 Comments
For some reason, removing the page level ErrorPage redirects resolved the problem for me. The redirect in the web.config (cUstomErrors tag) works but the page level redirects stop elmah from logging errors. Just something quick and easy to check for. Hope that helps some folk in my situation.