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
- Download ELMAH.dll ( http://elmah.googlecode.com/)
- Copy the ELMAH.dll into Bin/Lib(Reference). (Eventully while running the application the dll should copy into the Bin folder)
- Edit Web.Config as follows add following
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