Currently on ELMAH error logs, we want to eliminate/remove 404 errors since this is useless and consuming our database storage.
Any idea how to exclude the 404, especially through the web.config?
Currently on ELMAH error logs, we want to eliminate/remove 404 errors since this is useless and consuming our database storage.
Any idea how to exclude the 404, especially through the web.config?
You can easily skip 404 errors by having the below set on the web configuration file of your site:
<elmah>
<security allowRemoteAccess="yes" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah-ErrorLog" applicationName="YourAPPName" />
<errorFilter>
<test>
<or>
<regex binding="Exception.Message" pattern="Server cannot modify cookies after HTTP headers have been sent\." />
<equal binding="HttpStatusCode" value="404" type="Int32" />
</or>
</test>
</errorFilter>
</elmah>