Error filters in web.config are ignored when using ErrorLog_Filtering with ELMAH

浪尽此生 提交于 2019-12-13 00:12:01

问题


I have implemented an elmah filter that removes sensitive information from the exception being recording using a method similar to the one described here by overriding ErrorLog_Filtering in Global.asax.

This works great, but it ignores the filters I have setup in web.config via the <errorFilter> elements.

Is there some way I can apply my custom sanitization filter, but still make use of the filtering specified in web.config as well?


回答1:


Answering my own question here -- it was as simple as checking if e.Dismissed has already been set (for example, by the error filter module) before processing/recording the exception it in my santization helper.



来源:https://stackoverflow.com/questions/44524246/error-filters-in-web-config-are-ignored-when-using-errorlog-filtering-with-elmah

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!