Click to add

Click to add
ex: [email protected]

Click to add
What would you like to tell me?

 

  • Home
  • Blog
  • Portfolio
  • Articles
  • Downloads
  • Contact

This is how I blog...

  • Home/
  • Blog/
  • Installing ELMAH with Sitefinity

Installing ELMAH with Sitefinity

ELMAH: Error Logging Modules and Handlers for ASP.NET is a pretty awesome error logger.  I've installed it on a couple sitefinity instances so I figured I'd blog about it to help some others with it.

If you've never seen it, here are a couple resources:

  1. Scott Hanselman
  2. Detailed Setup Document

 It's an HttpModule which intercepts all crashes and logs them to a single table in your database, then provides a nice simple interface (and rss feed) to see the log items.

STEP 1: Web.Config Updates

<configSections>
    <sectionGroup name="elmah">
        <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
        <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
        <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
    </sectionGroup>
....
 
<!-- THIS IS THE CONFIG SECTION DESCRIBED ABOVE -->
<elmah>
        <security allowRemoteAccess="1"/>
        <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Sitefinity" />
        <errorMail from="[email protected]" to="[email protected]" priority="high" />
    </elmah>
 
 
<!-- SETUP THE HANDLERS FOR IIS6 -->
<httpHandlers>
    <add verb="POST,GET,HEAD" path="/sitefinity/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
...
 
<httpModules>
   <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
   <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
   <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
...
 
<!-- OR HANDLERS FOR IIS7-->
<modules>
     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
...
 
<handlers>
   <remove name="ErrorLog" />
   <add name="Elmah" verb="POST,GET,HEAD" path="/sitefinity/elmah.axd" preCondition="integratedMode" type="Elmah.ErrorLogPageFactory, Elmah"/>
 
 
<!-- PLACE AFTER SYSTEM.WEB, RESTRICTS ACCESS TO ADMINS ONLY -->
<location path="sitefinity/elmah.axd">
      <system.web>
        <authorization>
          <allow roles="administrators" />
          <deny users="?"/>
        </authorization>
      </system.web>
    </location>

STEP 2: SQL Script to create the table (included in the download file in the db folder)

STEP 3: Copy the Assemblies to your bin folder (ignore the SqlLite and VistaDB dlls)

Now you can visit http://www.yoursite.com/Sitefinity/elmah.axd, log in, and hopefully see no errors ;)

ELMAH: Error Logging Modules and Handlers for ASP.NET is a pretty awesome error logger. I've installed it on a couple sitefinity instances so I figured I'd blog about it to help some others with it.
tutorial
elmah
  • LinkedIn
Back to all posts
March 15, 2012   /  
Visit Steve on Google+
comments powered by Disqus

Search

Blog Categories

  • fixes
  • news
  • other
  • previews
  • rants
  • reviews
  • tutorial

Recent Comments

Tags

3x404243444x5253AjaxAnalyticsAsp.netBetablog-postboolChoiceFieldCommunityContentViewContextContractControlscssCTPCufonDatabaseDelaysDesignDetailDisqusdowntimeDropboxdynamicDynamicContenteCommerceELMAHEnergy-MarketersEntendingErrorEventsExtensionFieldControlFixFlatTaxonFieldFontsFormsGeneric-ContentGoogleHierarchicalTaxonFieldhostingHtmlimageImagesjavascriptJobjQueryJustJustCodeJustDecompileJustTraceKendoUILayoutControlsLogMarketersMasterMindscapeMinificationModule-Buildernew-productsNotesOpenAccessOptomizationPage-EditPerformancePITSportfolioPreviewPrimerRackspaceRadChartRadControlsRadEditorRadNotificationRadStyleSheetManagerRadXmlHttpPanelreleaseReportingResolutionReviewroadmapRoutingScamScrewedSDKSearchSelectorsServicessitefinitySkinsSpeedSQLStored-ProcedureStored-ProceduresteleriktellarickTemplatesthemeToolsUpdateuptimeVersionsViewstateWCFwebinarWebservicesWF4XmlHttpPanelYSOD
FreshBooks

Latest Blog Posts

  • The Sitefinity ContentView can be an ass#$%@ sometimes
    The problem with the assumtions Sitefinity ContentView makes
  • Fixing Ugly Hierarchical DynamicContent Urls
    Sitefinitys default Hierarchical DynamicContent control has no Url flexability...here's how we can fix all that so we have nicer routing.

Recent Twitter

Recent Comments

Address

Hamilton, ON
Canada
Site: http://www.sitefinitysteve.com
Email: contact
Buy me a beer

Disclaimer

Important: This site is perhaps too awesome for some users.  Please self govern your own awesomeness before browsing the awesome content.  
Telerik MVP Logo

Back to Top