Kent J. Chen's WebLog

...information technology, internet, and random thoughts

Error Logging Modules & Handlers (ELMAH)

The Error Logging Modules And Handlers (ELMAH) were written by Atif Aziz and Scott Mitchell, and demonstrate an easy means to add error logging capabilities to an ASP.NET Web application. ELMAH illustrates how HTTP modules and handlers can be used to provide a high degree of componentization for code that is orthogonal to the Web application (such as application-wide logging). ELMAH is a truly pluggable solution, meaning that it can be dynamically added to a running ASP.NET Web application without any need for recompilation or redeployment.

Regardless of the reason, when an exception occurs, especially on a live site, it is important that the details of the exception are recorded in order to assist with diagnosing the problem. ELMAH provides a mechanism for centralized error logging and notification. Whenever an exception occurs in an ASP.NET application that is not caught, ELMAH is notified and handles the exception as spelled out in the Web.config file. This may include recording the details of the exception to a database, sending an e-mail to an administrator, or both.

You can implement this wonderful module as simple as the 4 steps described below:

  1. Download the file from ELMAH GotDotNet Workspace;
  2. Upload the package to your webserver;
  3. Run SQL script to create the SQL table and Store Procedures. You can also configure it not to use SQL backend database as the storage to store all logs;
  4. Wire up Web.Configure file.

Download from ELMAH GotDotNet Workplace

If you haven't got it implemented in your web application, you really should run and get it. Highly recommened.

Print | posted on Monday, July 11, 2005 3:48 PM |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 6 and 4 and type the answer here:

My Recent Posts