Monday, June 22, 2009

ELMAH (Error Logging Modules and Handlers For ASP.Net)

ELMAH a Free plug and play error handling tool for ASP.NET (MVC too)
ElMAH is a 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 and re-deployment.

Few Steps for Error Handling
  1. Download ELMAH.dll ( http://elmah.googlecode.com/)
  2. Copy the ELMAH.dll into Bin/Lib(Reference). (Eventully while running the application the dll should copy into the Bin folder)
  3. Edit Web.Config as follows add following

http://blog.ninethsense.com/elmah-integration-to-aspnet-in-simple-steps/

Done, You have successfully configured ELMAH in your application.

Now run your application, You can see the errors in your browser itself.

Suppose your appliation URL is http://localhost:xxxx/TESTAPP/Default.aspx , you can view the error log in http://localhost:xxxx/TESTAPP/elmah.axdelmah.axd.

Storage of error logging can be done as

1) In-Memory

2) SQL Server , etc

Errorlog page can make secure too -- http://code.google.com/p/elmah/wiki/SecuringErrorLogPages

Good Reference - http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForASPNETAndMVCToo.aspx

No comments:

Post a Comment