Elmah filters 404 errors from email, but logs to database

I use Elmah to register errors in the database and send an error message. I created a filter to not send 404 page errors by email, but it also filters them from the database.

How to create a filter to prevent certain errors from being sent by email, but to allow them to register in the database?

I would prefer a web.config solution.

Update:

I am not against the decision.

+6
source share
1 answer

In the web.config elmah section, add:

<errorFilter> <test> <and> <equal binding="HttpStatusCode" value="404" type="Int32" /> <regex binding="FilterSourceType.Name" pattern="mail" /> </and> </test> </errorFilter> 

Here you can find the wiki:

http://code.google.com/p/elmah/wiki/ErrorFiltering

+8
source

Source: https://habr.com/ru/post/894269/


All Articles