Steps
- Install Elmah strongly signed assembly to GAC.
- Add Elmah connection string to Connection Strings in features view (IIS 7) on server level.
- Change .NET Framework version to 4.0
- Make sure all apps are running .NET 4 (in my case they are).
- Open C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\web.config as admin
- Add the following lines:
<configsections>
...
<!-- Begin an ELMAH specific section -->
<sectionGroup name="elmah">
<section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=d91c50d0d0b9de11"/>
<section name="errorLog" requirePermission="false"
type="Elmah.ErrorLogSectionHandler, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=d91c50d0d0b9de11"/>
</sectionGroup>
<!-- End an ELMAH specific section -->
</configSections>
<!-- Begin an ELMAH specific section -->
<elmah>
<security allowRemoteAccess="yes" />
<errorLog type="Elmah.SqlErrorLog, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=d91c50d0d0b9de11"
connectionStringName="ELMAH" />
</elmah>
<!-- End an ELMAH specific section -->
<!-- Begin an ELMAH specific section -->
<location path="elmah.axd">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<!-- End an ELMAH specific section -->
- In Features View on the server level open Modules and add : Name = Elmah, Type = Elmah.ErrorLogModule, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=d91c50d0d0b9de11
- In Features View on the server level open Handler Mappings and add Managed Handler. Name = Elmah-Logging, Path=elmah.axd, Type = Elmah.SecuritySectionHandler, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=d91c50d0d0b9de11
- Make an app throw an exception.
- Check Elmah DB for logged errors.
No comments:
Post a Comment