ASP.NET 应用程序未记录到 Windows 事件日志
我有两个 ASP.NET MVC Web 应用程序。其中之一将未处理的异常记录到 Windows 事件日志中。另一个则不然。
IIS 或 web.config 中是否有启用事件日志记录的设置?
对于这个广泛的问题,我深表歉意,我真的在寻找调查途径。
I have two ASP.NET MVC web applications. One of them logs unhandled exceptions to the windows event log. The other doesn't.
Is there a setting in IIS or the web.config to enable event log logging?
Apologies for the broad question, I'm really looking for avenues for investigation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这通常是由于运行 Web 应用程序的帐户没有写入事件日志的正确权限。
在 IIS 7 中,检查运行应用程序池的标识。
This is normally due to the account running the web application not having the right permissions to write to the event log.
In IIS 7, check the identity the application pool is running under.
如果运行 web 应用程序的用户(IIS 用户)不是管理员,请确保事件源已在操作系统中注册。
If the user running the webapp (the IIS user) isn't an admin, make sure that the event source is registered with the OS.
打开 CustomErrors 开始将内容添加到错误日志中。
最终的解决方案是添加
到
web.config 的部分。这在 IIS7 中启用了 Elmah。
理解松散 - 异常被 elmah 拦截,由于上述原因,elmah 配置错误,导致错误被吞没。打开自定义错误,似乎绕过了 elmah 并使错误能够推送到事件日志。
Turning CustomErrors on started stuff being added to error log.
Final solution was to add
to the
Section of the web.config. This enabled Elmah in IIS7.
Loose understanding - exceptions were being intercepted by elmah, which was mal-configured for the above reason, causing swallowing of errors. Turning custom errors on, seemed to bypass elmah and enable errors to push through to event log.