如何删除“Auth_Password”来自 ELMAH 日志
出于相当明显的原因,我想确定删除 ELMAH 捕获的 Auth_Password 的最佳方法。这样做的最佳方法是什么?
For fairly obvious reasons, I would like to identify the best way to remove the Auth_Password from being captured by ELMAH. What is the best way to go about doing so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
由于 ELMAH 是开源的,我像这样修改了 Error.CS 文件。在 Error.CS 的 Error 构造函数内部(大约第 126 行),我添加了以下内容:
Since ELMAH is open source, I modified the Error.CS file like so. Inside of the Error cunstructor of Error.CS (about line 126), I added this:
我已经设法在不修改 ELMAH 源的情况下做到这一点: http://www.kipusoep.nl/2012/01/06/umbraco-elmah-with-sql-ce-4-0-and-authentication-part-2 /
I've managed to do this without modifying the ELMAH source: http://www.kipusoep.nl/2012/01/06/umbraco-elmah-with-sql-ce-4-0-and-authentication-part-2/
我刚刚遇到同样的事情;使用以下方法解决:
并将 web.config、configuration/system.webserver/modules 中的 ErrorLog 模块更新为:
这将解决问题,无需第二次往返。如果随后从传入请求中使用密码,那么这不是问题,因为 Elmah 源显示它需要副本。
我意识到对上述问题的回应有点晚了,但问题似乎已在当前的 Elmah for ASP 中得到纠正,而对于 Elmah.Mvc nuget 包则没有得到纠正。
I just encountered the same thing; solved using the following:
And updated the ErrorLog module in web.config, configuration/system.webserver/modules to:
This will solve the problem without a second round trip. Not a problem if the password is subsequently used from the incoming request as the Elmah source shows it takes a copy.
I realize this is a bit late in response to the above, but the problem seems to have been corrected in current Elmah for ASP, and not for Elmah.Mvc nuget package.
我无法让@Dominic Birch 的答案起作用,因为上下文是只读的。相反,我从 ErrorLog(在我的例子中是 MySqlErrorLog)派生并在那里执行:
I wasn't able to get @Dominic Birch's answer working, because context is readonly. Instead, I derived from the ErrorLog (in my case, MySqlErrorLog) and did it there: