ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.
Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilites without changing a single line of your code:
- Logging of nearly all unhandled exceptions.
- A web page to remotely view the entire log of recoded exceptions.
- A web page to remotely view the full details of any one logged exception.
- In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned off.
- An e-mail notification of each error at the time it occurs.
- An RSS feed of the last 15 errors from the log.
- A number of backing storage implementations for the log, including in-memory, Microsoft SQL Server and several contributed by the community.
New with ELMAH 1.0 BETA 3 (build 10617)
- A self-contained demo Web site showing error logging and mailing in action right out of the box. Run demo.cmd in the root of the distribution.
- Log errors to new back-end storages:
- New HTTP module, MsAjaxDeltaErrorLogModule, to log errors during partial updates enabled by UpdatePanel in Microsoft ASP.NET AJAX.
- Use ErrorLogDataSourceAdapter together with ObjectDataSource from ASP.NET to create your own custom views of the error log, almost purely in server-side markup and without a line of code!
- Get error data in JSON (in addition to XML) from the detail page of an error.
- Use JavaScript to express complex conditions for filtering exceptions in a more concise and familiar manner. See sample web.config for examples.
- Support for |DataDirectory| macro to avoid absolute paths in connection strings.
- Compiled for .NET 3.x (and 2.0 and 1.x as before).
- Solution files for Visual Studio 2002, 2003, 2005 and 2008.
- And, of course, lots of fixes. Yep, that's a feature too! :)
The following features were new with ELMAH 1.0 BETA 2 (build 9414):
- Support for ASP.NET 1.x and 2.0.
- Support for medium trust under ASP.NET 2.0.
- Exception filtering (programmatically and via configuration)
- An about page describing the deployed build, composition and configuration of ELMAH.
- Integrated file-based XML error log (contributed by Scott Wilson to the original GDN-ELMAH release as a stand-alone log implementation).
- Log errors to a SQLite (version 3) database file.
- A digest RSS feed that lists errors by day and up to last 15 days.
- Centralized and programmatic way of signaling exceptions that don't bubble up to ASP.NET runtime (handy for services and Ajax scenarios where unhandled exceptions are usually propagated to the client).
- Download the whole error log into a single CSV file for analysis, filtering and charting using Microsoft Excel or Microsoft Log Parser.
- Much improved performance of large logs when using Microsoft SQL Server 2000 or later.
- Improved scalability when using Microsoft SQL Server 2005 or later.
- Improved default security. ELMAH now blocks remote access to the error log and details unless configured otherwise.
- Access to the raw XML behind any logged error from its details page, making it easier to get to information (like form data, including View State) that, until now, had to be grabbed directly out of the error log's backing store.
- Pages conform to XHTML 1.0 Transitional, making them parsable using any XML DOM API and shrugging quirks mode.
- Support for the ASP.NET web application root operator (~) in paths in XML file-based and SQLite error log implementations.
- Ability to check for updates.
ELMAH in Action
Following is a screenshot of Internet Explorer 7 displaying the error log page as provided by ELMAH:
To learn more about ELMAH, see the MSDN article “Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components” by Scott Mitchell and Atif Aziz.
