ELMAH is an incredibly neat web development tool that attaches quickly and easily to any .Net website without needing to recompile the source and gives an incredibly useful overview of all unhandled exceptions that have occured on the site. Other errors such as 404’s are also displayed.
To get started with ELMAH follow these simple steps:
- Download ELMAH from http://code.google.com/p/elmah/
- Extract the contents and run the SQL script located in the db folder against your project database
- Open the Web.config.template folder which is located in samplesDemo. This gives you an overview of the changes you need to make to your web.config file for ELMAH to work.
- When you’re done configuring your web.config copy the Elmah.dll for your version of .Net in to your bin folder. Then attempt to load your website.
- Any errors displayed will almost certainly be as a result of errors in your web.config changes.
- If your site loaded successfully, chances are ELMAH is working. Navigate to http://yoursite/elmah.axd and you should see the default ELMAH log page.
- Yourmay wish to hide your elmah page by either securing it using web.config or simply moving the location of the elmah page away from the default location. This is easily done by updating the path attribute your web.config line:<add verb=”POST,GET,HEAD” path=”elmah.axd” type=”Elmah.ErrorLogPageFactory, Elmah”/>
- ELMAH provides a configuration section and setting to enable or disable remote access to the error log display and feeds. When disabled (the default), only local access to the error log display and feeds is allowed. The snippet below shows how to enable remote access:<elmah> �
<security allowRemoteAccess=”1″ /> �
</elmah>
We recommend using the RSS feeds and built in e-mail notifications to ensure that you’re always one step ahead of those pesky exceptions!