Following the suggestion from Scott and Jeff, I decide to have ELMAH implemented in my current ASP.NET application as well. The whole progress is really straightforward and painless. Most of the work is to modify the application’s web.config file.
- Download the latest version of bin, currently 1.0 version, from project’s web site, hosted on Google code.
- Based on the version of your ASP.NET application, reference the corresponding Elmah.dll from the subfolder. You might need to reference SQLite.dll if you need to use SQLLite for the log storage.
- Modify the Web.config based on the sample Web.config file coming with the sample. You can check it from here as well.
That is it! Then you can find the unhandled exception by access http://yourwebsite/elmah.axd. You will see the error page is something like
From what I see so far, ELMAH is
- Easy to implement and set it up
- Flexible to offer multiple log storage providers, including SQL Server, SQLLite, Oracle, XML, and In-memory.
- Readable, the log is formatted in a HTML table, which can be also export to CVS file and be queried by Microsoft’s Log Parser tool.
- Reliable, it provides multiple notification channels, including Email, RSS and even Tweet.
Just as Jeff Atwood said in his blog above, the main purpose of setting up ELMAH in our application is to find out the accurate, valuable and real time “feedback” of the applications we built automatically.
Happy coding, till next time!
