ELMAH integration to ASP.NET in simple steps
For this experiment, I have used a new web application on visual studio 2008.
1. Download latest version from http://elmah.googlecode.com/
2. Reference the Elmah.dll file from the downloaded files (Eg: \ELMAH-1.0-BETA3-bin\bin\net-3.5\Elmah.dll)
3. Add below code in your web.config file - under configuration node:
<br /><sectiongroup name="elmah"> <br /><section name="security" type="Elmah.SecuritySectionHandler, Elmah" requirepermission="false" /> <br /><section name="errorLog" type="Elmah.ErrorLogSectionHandler, Elmah" requirepermission="false" /> <br /><section name="errorMail" type="Elmah.ErrorMailSectionHandler, Elmah" requirepermission="false" /> <br /><section name="errorFilter" type="Elmah.ErrorFilterSectionHandler, Elmah" requirepermission="false" /> <br /></sectiongroup> <br />
4. Now add http handler - in the
<br /><add type="Elmah.ErrorLogPageFactory, Elmah" path="elmah.axd" verb="POST,GET,HEAD" />5. Now enable the logging feature. For that add the below line in
<br /><add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />In this point you can test the error page: http://yourhost/yoursite_path/elmah.axd
6. Default storage of errors will be ‘memory’ you can choose other available methods also - XML files, SQLLite and SQL Server. Here I will use SQL Server.
7. Add this inside
<br /><errorlog type="Elmah.SqlErrorLog, Elmah" connectionstringname="Your_Connection_String_Name" />8. Execute the \ELMAH-1.0-BETA3-bin\db\SQLServer.sql file from SQL Server Management studio.
9. Everything done. There are many options available. Research!
Additional notes:
If you use URL re-writing features in asp.net then you willl have to use this also in web.config:
<location path="elmah.axd"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>
You can ask questions here: http://kidoos.net/forums/t/213.aspx
Related posts:























Leave a Reply
You must be logged in to post a comment.