ASP.NET错误处理 [英] ASP.NET Error Handling

查看:111
本文介绍了ASP.NET错误处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp.net应用程序中,我通常使用Application_Error全局事件处理程序来记录错误,并将用户重定向到用户友好的错误页面。

In my asp.net applications, I've typically used the Application_Error global event handler to log the error and redirect the user to a user-friendly error page.

但是,我已阅读有关 ELMAH 而且似乎很有意思,Application_Error似乎是更简单的方法。

However, I have read about ELMAH and while that seems interesting, Application_Error seems like the simpler approach.

我已经阅读了其他问题,包括我自己在内的人已经提出了一种方式。我想知道的是,如果使用一个在另一个有什么重大的好处,为什么?

I've read other questions where people, including myself, have suggested one way or the other. What I'm wondering is if there is any significant benefit to using one over the other and why?

推荐答案

Elmah是一个梦幻般的我们将其用于所有ASP.NET应用程序。它不仅记录了您未经处理的错误,还会抓住用户看到的整个原始页面,其中包含您的详细信息。

Elmah is a fantastic project and we use it for all of our ASP.NET applications. Not only does it log unhandled errors for you, it grabs the entire original page that the user saw, which contains a lot of detail for you.

它有电子邮件支持,RSS提要(包括细分和摘要),并有一个有吸引力的控制台。

It has email support, RSS feeds (both itemized and digest) and has an attractive console.

对于配置和dll参考中的3行,我会说这是一个扣篮。

For 3 lines in config and a dll reference, I'd say that's a slam dunk.

这篇关于ASP.NET错误处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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