Combining the goodness that is ELMAH with FogBugz

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="webserver@example.com"
   4:         project="Misconfigured"
   5:         url="https://yoururl.fogbugz.com/ScoutSubmit.asp"
   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.

    Month List

    Recent Tweets

    Twitter May 3, 14:32
    New blog post: http://t.co/4oTIhV1rML - To observe or not to observe? That is the question…

    Twitter April 8, 23:17
    #SignalR is fun

    Twitter December 20, 04:04
    Updated blog post: http://t.co/ETo7eiH5 - A Quick Comparison Between jsViews and Knockout

    Twitter December 10, 16:44
    Haha

    @wforney

    Widget Twitter not found.

    Root element is missing.X

    VSAchievements

    Visual Studio Achievements
    Bill Forney (157 Points)
     
    Bill's bookshelf: read

    How to Win Friends & Influence People Getting Things Done: The Art of Stress-Free Productivity The Fellowship of the Ring The Dragon Reborn A Game of Thrones Towers of Midnight

    More of Bill's books »
    Book recommendations, book reviews, quotes, book clubs, book trivia, book lists

    Recent Comments

    Comment RSS

    About the author

    William L. Forney was born in Pennsylvania and relocated to Washington State in early 1999. His hobbies include all the usual things: movies, books, music, video games, etc. He writes short sci-fi/fantasy stories which will someday be published in the form of small novels.

    Bill's Photograph

    He loves computers and has worked in several different areas from web, multimedia, video and 3D animation to database and windows development.

    Currently he works at Visible Reality, LLC as the lead developer and improvGroup, LLC as a networking consultant.

    He also works with Padgett & Padgett, PLLC, the accounting firm where he setup shop after moving.

    His other blog can be found here.