I couldn’t find one single resource where I could easily compare ELMAH with the Enterprise Library Logging application block. Instead, the various features, benefits and design of these two logging frameworks are spread across multiple websites. Hence, I have collated information from these disparate sources hoping that it would bring about a succinct yet meaningful comparison between the two.
Enterprise Library Logging Application Block
The Enterprise Library Logging Application Block simplifies the implementation of common logging functions. You can use the Logging Application Block to write information to a variety of locations:
- The event log
- An e-mail message
- A database
- A message queue
- A text file
- A Windows® Management Instrumentation (WMI) event
- Custom locations using application block extension points
Features
- Multiple targets can be configured
- Enterprise Library Configuration Console available for easy configuration
- Large number of options to be configured may make it a bit daunting to start with
- Invasive – requires code change to implement logging
- Logs all kinds of events/information, not just for error logging
- Formatters available for formatting the event message
- Log filters allow filtering of log messages
- Facilities for WCF integration
Comparison with ELMAH
Feature/s | Logging Application Block |
ELMAH |
Scope |
|
|
Targets supported |
|
|
Pluggable? | No. Requires careful configuration and implementation in code | Fully pluggable out of the box, requires only configuration for basic features |
Configuration |
|
XML configuration in the web.config |
Intrusiveness | Requires code change for implementation | No code change required for basic features |
Extensibility |
|
|
Scalability |
|
Requires more research |
Summary
The Logging Application block beats ELMAH hands down in comprehensiveness. It can be used for logging all kinds of messages from all layers of various kinds of applications including ASP.NET, windows forms, WCF services etc. It can also be used for tracing for performance and debugging purposes.
On the other hand ELMAH is a light-weight framework for logging exceptions in ASP.NET applications.
ELMAH is very easy to configure and use. It is fully pluggable. Whereas implementation of the Logging Application block requires careful planning, configuration and is intrusive as it requires changes to code wherever logging is required.
One of the biggest benefits of the Enterprise Library is that it works in tandem with the Exception Handling block to implement a consistent strategy for processing exceptions in all the architectural tiers of an enterprise application including WCF Services.
While ELMAH is perfect for ASP.NET applications, for enterprise applications the Enterprise Library fulfills the comprehensiveness required.
References:-
- http://msdn.microsoft.com/en-us/library/ff664569%28v=pandp.50%29.aspx
- http://www.codeproject.com/Articles/9545/Get-Logging-with-the-Enterprise-Library
- THE ELMAH REPORT
- http://msdn.microsoft.com/en-us/library/ff664698%28v=pandp.50%29.aspx
- http://stackoverflow.com/questions/766610/how-to-get-elmah-to-work-with-asp-net-mvc-handleerror-attribute/5936867#5936867
- http://code.google.com/p/elmah/wiki/DotNetSlackersArticle#Logging
- http://mikee.se/Archive.aspx/Details/elmah_on_steroids_20100403