Combining the goodness that is ELMAH with FogBugz

by wforney 1. November 2010 07:31

I use ELMAH for error handling on a lot of my projects and recently started using FogBugz again after a brief hiatus. The only problem was that to use FogBugz with BugzScout I had to put code in my applications when I already had ELMAH running. I thought that wasn’t very elegant so I grabbed the ELMAH source and the BugzScout source and hacked together a module for ELMAH that will submit to FogBugz. Please note that the formatting needs work as it submits a bunch of HTML at the moment, which FogBugz is interpreting as plain text. Once I get that fixed I’ll post an update or feel free to send me one if you’re ambitious.

I’ve linked the sample files above if you care to look. Just add these to the ELMAH project and use the custom configuration section…

   1: <errorFogBugz
   2:         area="Misc"
   3:         customerEmail=""
   4:         project="Misconfigured"
   5:         url=""
   6:         userName="John Doe"
   7:         defaultMessage=""
   8:         forceNewBug="false"
   9:         />

And you have to add the config section to the top…

   1: <section name="errorFogBugz" requirePermission="false" type="Elmah.ErrorFogBugzSectionHandler, Elmah"/>

Finally you add the module to your modules sections…

   1: <httpModules>
   2:     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
   3:     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
   4:     <add name="MsAjaxDeltaErrorLog" type="Elmah.MsAjaxDeltaErrorLogModule, Elmah"/>
   5:     <add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah"/>
   6:     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
   7:     <add name="ErrorFogBugz" type="Elmah.ErrorFogBugzModule, Elmah"/>
   8:     <!--<add name="FixIIS5xWildcardMapping" type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>-->
   9: </httpModules>

or for IIS7 use this one…

   1: <system.webServer>
   2:         <validation validateIntegratedModeConfiguration="false"/>
   3:         <modules runAllManagedModulesForAllRequests="true">
   4:             <add name="ErrorMail" preCondition="managedHandler" type="Elmah.ErrorMailModule, Elmah"/>
   5:             <add name="ErrorLog" preCondition="managedHandler" type="Elmah.ErrorLogModule, Elmah"/>
   6:             <add name="MsAjaxDeltaErrorLog" preCondition="managedHandler" type="Elmah.MsAjaxDeltaErrorLogModule, Elmah"/>
   7:             <add name="ErrorTweet" preCondition="managedHandler" type="Elmah.ErrorTweetModule, Elmah"/>
   8:             <add name="ErrorFilter" preCondition="managedHandler" type="Elmah.ErrorFilterModule, Elmah"/>
   9:             <add name="ErrorFogBugz" preCondition="managedHandler" type="Elmah.ErrorFogBugzModule, Elmah"/>
  10:         </modules>
  11:         <handlers>
  12:             <add name="Elmah" preCondition="integratedMode" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
  13:         </handlers>
  14: ...

I hope that someone finds this useful. If there is interest I may package these as a companion library for ELMAH or contribute them to the project.

Tags: ,

C# | Software Development | Technology


<<  August 2014  >>

View posts in large calendar

Month List

Page List

Email Subscription


Comment RSS


( Points)