问题
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