This project is read-only.

ELMAH HttpModule


The ELMAH HttpModule is created to make sure that all the errors are caught on a website or web application. If an error where to occur on or in the ELMAH HttpModule the error won’t be logged to the folder as an xml file, but will be written to the trace instead. The philosophy behind this is that an application should not stop working just because the error logging system does not work.

Installation / Configuration

Dowload OrbitOne.Elmah.HttpModule.Zip and extract somewhere.
The zip file contains 2 folders: the .Net 2.0 and the .Net 1.1

If you have both versions of websites you can use all 4 dll’s at the same time. If you only need one of the two versions, there is no need to copy the other version.
I’ll assume you know which version you need.

For the .Net 2.0 version the public key token = ab9cc0e617757f7b
For the .Net 1.1 version the public key token = d633d0581a25beaf

Add the redirection of the errors to the web.config of your websites/webapps:
	<error statusCode="500" redirect="500.html" />
	<error statusCode="404" redirect="404.html" />

Next chose how you want to log and follow the steps below

Configuration at Machine Level

This is only needed when you want to monitor all the sites on your server. No additional configurations will be needed.

To install the modules at machine level you have to complete following steps:
  • Place the dlls for the version you need in the GAC (%windir%\assembly)
    • Elmah.dll (version 1.0.8925.10000)
    • OrbitOne.Elmah.dll (version, Culture=neutral)
You can either drag and drop the assemblies to %windir%\assembly, or install them using gacutil:
gacutil.exe /i OrbitOne.Elmah.dll
gacutil.exe /i Elmah.dll
  • Open the machine.config file on your system (%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config)
  • And add the following to the configSections section:
<sectionGroup name="OrbitOne.Elmah">
       <section name="errorLog" 
	type="OrbitOne.Elmah.HttpModule.LogSectionHandler, OrbitOne.Elmah, Version=, Culture=neutral, PublicKeyToken=ab9cc0e617757f7b" />
      <section name="errorFilter" 
	type="OrbitOne.Elmah.HttpModule.FilterSectionHandler, OrbitOne.Elmah, Version=, Culture=neutral, PublicKeyToken=ab9cc0e617757f7b" />
  • And add the OrbitOne.Elmah section:
	<errorLog type="OrbitOne.Elmah.O1XmlFileErrorLog, OrbitOne.Elmah, Version=, Culture=neutral, PublicKeyToken=ab9cc0e617757f7b" 
		LogPath="C:\Program Files (x86)\Orbit One\Orbit One Elmah Agent Service\Logs" />
			<equal binding="HttpStatusCode" value="404" ValueType="Int32" />
  • Next add to the System.Web.HttpModules section. Make sure the first element in the section is the errorLog:

      <add name="ErrorLog" 
	type="OrbitOne.Elmah.HttpModule.O1ErrorLogModule, OrbitOne.Elmah, Version=, Culture=neutral, PublicKeyToken=ab9cc0e617757f7b" />
      <add name="ErrorFilter" 
	type="OrbitOne.Elmah.HttpModule.O1ErrorFilterModule, OrbitOne.Elmah, Version=,Culture=neutral, PublicKeyToken=ab9cc0e617757f7b" />

Configuration at Site Level

To install the module on a single site, place the Elmah.dll and the OrbitOne.Elmah.dll in your website/webapp’s bin directory. Next follow the steps of the machine level and apply those in your web.config.

Configuration for SharePoint Site

  • For SharePoint 2003 site: use the .Net 1.1 version.
  • For SharePoint 2007 site: use the .Net 2.0 version.
There is only one difference with a regular site level installation. You need to change the redirection of the custom error pages as following:
	<error statusCode="500" redirect="~/_layouts/1033/error.aspx" />

Last edited Jan 28, 2011 at 9:42 AM by melg, version 11


No comments yet.