MVC ELMAH v / s Application_Error [英] MVC ELMAH v/s Application_Error

查看:232
本文介绍了MVC ELMAH v / s Application_Error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

我有 [HandleError] 在我的MVC Web应用程序中的异常处理,但后来它不能处理一些异常,所以建议您转到另一个 Application_Error 我的SO发布)我也最终使用 ELMAH ,似乎更好。

I had [HandleError] in place in my MVC web app for exception handling but later it couldn't handle some exceptions so I was suggested to move on to the alternative Application_Error (my SO Post) I also ended up using ELMAH which seems better.

!但是我无法找到如何显示格式化的异常(就像我用Application_Error一样)

Well, ELMAH rocks! But I was unable to find how to show formatted exception with it (like I do with Application_Error)

ELMAH - 提供(几乎)开箱即用的异常记录和其他功能,如电子邮件。它完全依赖于web.config和一堆它需要的文件。能够在xml /数据库(配置)中记录异常,并且能够使用电子邮件,rss等。提供一个页面,用户可以查看完整的异常日志和详细信息。

ELMAH - Provides (almost) out of the box exception logging and other features like email. Its completely dependent on web.config and a bunch of files it requires. Able to log exception in xml / database (as configured) and is capable of email, rss, etc. Provides a page where user can view the full exception log and drilldown for details.


优点:错误后不显示格式化的异常。使web.config有点笨重。 ELMAH文件的集合是2.8mb(超过我的整个Web应用程序zip的两倍的
)。无法格式化错误/电子邮件。它依赖于
System.Data.SQLite.dll是CPU架构依赖(x64或
x86) SO post

Pros: Doesn't show formatted exception upon error. Makes the web.config a bit bulky. The set of ELMAH files is 2.8mb (more then twice the size of my entire web app zip). Can't format error / email. It is dependent on System.Data.SQLite.dll which is CPU architectue dependent (x64 or x86) SO post

Application_Error - 捕获所有异常,我们可以导航用户显示格式化错误。我们控制正在显示和发送电子邮件。完全托管的代码(没有CPU依赖)没有额外的web.config设置。没有额外的数据。

Application_Error - Catches all the exception and we're able to navigate user to show a formatted error. We control what is being showed and Emailed. Completely managed code (no CPU dependency) no extra web.config settings. No extra dlls.


优点:没有隐式异常记录(我们需要编码)。没有日志查看器
喜欢ELMAH。电子邮件,记录 - 我们必须管理所有。

Pros: No implicit exception logging (we need to code). No log viewer like ELMAH. Email, logging - we've to manage all.

结论:
首先,请告诉我,如果ELMAH可以完全替换我的Application_Error。另外,我没有发现如何配置ELMAH显示/电子邮件的错误信息。或者他们必须共存 (Application_Error显示格式错误和几乎所有其他的ELMAH)

请建议并分享您的经验。

Please suggest and share your experience.

推荐答案

我可以使用ELMAH(除了向用户显示格式化的异常详细信息)至少我没有找到任何东西)

I can live with ELMAH (except for showing formatted exception details to the user - or atleast I didn't find anything for that)

我想知道我的帖子中缺少什么来吸引SO观众。我的线程由Atif自己回答 - 更快,更简单!

I wonder what was missing in my post to attract SO audience. I got my thread answered by Atif himself - quicker, simpler!


https://groups.google.com/forum/?fromgroups=#!topic/elmah/Md9DslGgwNo

这篇关于MVC ELMAH v / s Application_Error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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