将ErrorLog_Filtering与ELMAH一起使用时,将忽略web.config中的错误过滤器 [英] Error filters in web.config are ignored when using ErrorLog_Filtering with ELMAH

查看:228
本文介绍了将ErrorLog_Filtering与ELMAH一起使用时,将忽略web.config中的错误过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了一个Elmah过滤器,该过滤器使用类似于所述 ErrorLog_Filtering 隐藏错误日志中的敏感表单数据

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.

这很好,但是它忽略了我通过< errorFilter> 元素。

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

是否可以通过某种方式应用我的自定义过滤器,但是仍然可以使用web.config中指定的过滤器?

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

推荐答案

在这里回答我自己的问题-就像检查 e.Dismissed 已经在我的上位助手中处理/记录了异常之前已经设置了(例如,由错误筛选器模块设置的)异常。

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.

这篇关于将ErrorLog_Filtering与ELMAH一起使用时,将忽略web.config中的错误过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆