MVC ELMAH V / S的Application_Error [英] 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.
好吧,ELMAH石头!但是我无法找到如何显示它格式化除外(例如我做的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 architectue依赖(64或
86) SO帖子
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 - 捕获所有异常而且我们能够导航的用户显示一个格式化的错误。我们控制的是什么表现和通过电子邮件发送。完全托管code(无CPU依赖)没有多余的web.config设置。没有额外的DLL。
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.
优点:否隐含的异常记录(我们需要code)。没有日志查看器
像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,以示对pretty太多一切格式错误和ELMAH)*
CONCLUSION: Firstly, please tell me if ELMAH can "completely" replace my Application_Error. Also, I didn't find much on how to configure the error message being displayed / emailed with ELMAH. Or do they have to co-exist *(Application_Error to show formatted error and ELMAH for pretty much everything else)*
请推荐并分享您的体验。
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 =#!话题/ ELMAH / Md9DslGgwNo
这篇关于MVC ELMAH V / S的Application_Error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!