Elmah not working with asp.net site Elmah not working with asp.net site asp.net asp.net

Elmah not working with asp.net site


I just had a similar problem with Elmah not working in an IIS7 deployment. I found that I needed to register the Elmah Modules and Handlers in system.web AND system.webServer:

<system.web>...  <httpHandlers>    ...    <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />    ...  </httpHandlers>  <httpModules>    ...    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />    ...  </httpModules>  ...</system.web><system.webServer>  ...  <modules runAllManagedModulesForAllRequests="true">    ...    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />    ...  </modules>  <handlers>    ...    <add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />    ...  </handlers><system.webServer>


You may be need this one also

<elmah>    <security allowRemoteAccess="1" /></elmah> 

when you get

403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.


Try registering the Modules and Handlers in the sections "httphandlers" and "httpmodules" in the <system.web> section:

    <httpHandlers>      ......    <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>      .....    </httpHandlers>    <httpModules>        .......        <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>        <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>        <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>       .......    </httpModules>