ELMAH vs Enterprise Library Exception Handling Block

前端 未结 4 2113
误落风尘
误落风尘 2020-12-31 15:00

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 an

相关标签:
4条回答
  • 2020-12-31 15:14

    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.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-31 15:34

    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.

    • It will take you a bit to get up to speed with Ent Lib - it's not a 5 second install and start using it thing.
    • There's alot of configuration to do in the app.config/web.config file just to make it work. That said, once you understand it, it easier on other projects.
    • You must implement the Logging Block, not just the Exception Handling Block to log the information somewhere (event log, flat file, database, etc.)
    • It's not just for logging exceptions. For example, many of our clients want to get log events for when a user logs in or logs out of an application.
    • You can use the configuration file to change how logging works depending on the environment (i.e. Log exceptions for Production, log everything for Dev, etc.).
    • It's not just for web, but for all kinds of applications.

    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.

    0 讨论(0)
  • 2020-12-31 15:40

    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.

    0 讨论(0)
提交回复
热议问题