Reputation: 27803
When I have my custom errors disabled, Elmah is taking all exceptions that occur and logging them into my database and emailing me.
However, the second I change my web.config to:
<customErrors mode="RemoteOnly" defaultRedirect="~/Home/Error">
</customErrors>
Elmah stops functioning. It no longer logs exceptions to the database or anything, all I see is my custom error action being executed.
How can I have custom error messages and still have elmah log exceptions? I am currently not doing any other exception intercepting besides Elmah.
Upvotes: 10
Views: 4398
Reputation: 27803
Figured it out!
The reason this was occurring was because I had filters.Add(new HandleErrorAttribute());
in Global.asax
. I don't know why this is there, but that was what was causing this to fail when custom errors was enabled. Removing this line caused Elmah to work properly with custom errors.
Also, telling elmah to log "handled" errors also works, as described by this answer.
I don't truely know the full ramifications of either option though.
Upvotes: 19