ELMAH 与企业库异常处理块
我的团队目前正在构建 ASP.NET MVC 应用程序,我们正在尝试决定实施哪些框架来处理错误处理和日志记录。
选择其中之一而不是其他的原因是什么?
My team is currently in the process of building an ASP.NET MVC application, and we're trying to decide which of these frameworks to implement to deal with error handling and logging.
What are the reasons for choosing one of these over the other?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
就我个人而言,我一直在为许多客户使用 Enterprise Library,但尚未使用 ELMAH。 这是我对 Ent Lib 的看法。
粗略地浏览一下 ELMAH 让我相信这是快速完成任务的好方法。 从长远来看,您可能想要具有额外功能的东西。
Personally, I've been using Enterprise Library for a number of our clients and I have yet to use ELMAH. Here's my thoughts on Ent Lib.
A cursory glance at ELMAH leads me to believe that it's a great way to get something up quick. Longer term, you may want something with additional power.
ELMAH 简单、易于使用且易于实施。 EntLib 规模庞大、“企业化”且功能强大。 就你的情况而言,根据我对你情况的了解,我会犹豫是否推荐任何东西。 然而,如果我必须为您选择一个,我会选择 ELMAH,原因如下。
ELMAH is simple, easy to use, and easy to implement. EntLib is big, "enterprisey", and powerful. In your case, based on the little I know about your situation, I would hesitate to recommend anything. However if I had to pick one for you I would say ELMAH for the reasons stated.
我可能在这里说错了,这种情况很常见,但是 EntLibrary 旨在帮助开发异常处理,而 ELMAH 只是向您展示异常发生的时间和地点。 如果您只是想要异常报告,请使用 ELMAH,如果您需要更强大的 EntLib。
I may be off base here, which is quite often the case, but EntLibrary is meant to help develop exception handling whereas ELMAH is jsut going to show you when and where exceptions occured. If you just want a report of exceptions use ELMAH, if you need more power EntLib.
此外,Elmah 专为捕获和记录未处理异常而设计。 它可以配置为记录捕获的异常,但这是最近添加的,而不是其主要目的。
Also, Elmah is designed specifically for capturing and logging unhandled exceptions. It can be configured to log caught exceptions, but that is a recent addition and not its primary purpose.