Tim

Footprints in the snow of a warped mind

Advanced Error Reporting in Umbraco, dasBlog and other ASP.Net sites

Where to find me

Flickr Icon  Twitter Icon  Linked In Icon  FaceBook Icon  Windows Live Alerts Butterfly  RSS 2.0 

Tag Cloud

AJAX (4) ASP (6) ASP.Net (50) Error Reporting (4) Web Service (1) WSDL (1) Atlas (2) Business (76) Business Start-up Advice (25) Client (14) Expanding Your Business (17) C# (16) Canoeing (4) Canoe Racing (5) Cheshire Ring Race (5) Racing (2) Training (4) CIMA (1) Cisco (1) 7970G (1) CSS (3) dasBlog (4) DDD (1) Design (9) Icons (1) Development (12) General (39) Christmas (6) Fun and Games (11) Internet (22) Random (46) RX-8 (8) Home Cinema (2) Hosting (2) IIS (10) iPhone (1) JavaScript (4) jQuery (1) Marketing (5) Email (1) Multipack (1) Networking (2) Nintendo (1) OS Commerce (1) Photography (1) PHP (1) PowerShell (2) Press Release (1) Productivity (2) Security (2) SEO (5) Server Maintenance (4) Server Management (9) Social Media (1) Social Networking (2) Experiment (1) Software (9) Office (5) Visual Studio (12) Windows (4) Vista (1) SQL (1) SQL Server (13) Stored Procedure (1) Testing (1) The Site Doctor (104) Turnover Challenge (1) Twitter (2) Umbraco (17) 2009 (1) Web Development (54) WebDD (33) Wii (1)

Blog Archive

Search

<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

Recent Comments

Blog Archive

Various Links

Blogs I Read

[Feed] Google Blog
Official Google Webmaster Central Blog
[Feed] Matt Cutts
Gadgets, Google, and SEO
[Feed] Ol' Deano's Blog
My mate Dean's blog on my space, equally as random as mine but not off on as much of a tangent!
[Feed] Sam's Blog
Sam is one of my younger brothers studying Product Design and Manufacture at Loughborough, this is his blog :) Enjoy!

Recent Tracks

last.fm - The Social Music Revolution

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

newtelligence dasBlog 2.2.8279.16125

Send mail to the author(s) Email Me (Tim Gaunt)

© 2010 Tim Gaunt.

Sign In

    # Friday, February 27, 2009

    Advanced Error Reporting in Umbraco, dasBlog and other ASP.Net sites

    Friday, February 27, 2009 3:51:13 PM (GMT Standard Time, UTC+00:00)

    If you've been following my blog you'll know that I've been raving about error reporting within ASP.Net (you can see my ASP.Net Error Reporting category for a couple of them if you like) but until now it's been limited to those sites that you have access to the global.asax file.

    One of the irritations I've found with Umbraco and dasBlog is that I don't get notified of errors as they're just logged to a text file/database somewhere. This is fine if you run 2 or 3 sites but we manage too many to check them all everyday. Instead we rely on email error notifications which until today have been a PITA to integrate into Umbraco.

    Today I'd like to introduce to you Error Handling v2.0 which instead of relying on the global.asax file for the error hooks, uses a HttpModule which means you can install it into any existing/pre-built application such as Umbraco and dasBlog.

    Adding it into the site is simple, you'll need to install the module into the web.config file and add the configuration section a sample (cut down) web.config is below:

    <?xml version="1.0"?> 
    <configuration> 
        <configSections> 
            <section name="tsdErrorsConfigSection" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
        </configSections> 
     
        <tsdErrorsConfigSection file="ErrorHandling.config"/> 
     
        <system.net> 
            <mailSettings> 
                <smtp from="you@yourdomain.com"> 
                    <network host="127.0.0.1" port="25" /> 
                </smtp> 
            </mailSettings> 
        </system.net> 
     
        <system.web> 
            <httpModules> 
                <add name="ErrorModule" type="TheSiteDoctor.ErrorHandling.ErrorModule, TheSiteDoctor.ErrorHandling" /> 
            </httpModules> 
        </system.web> 

    <!--  
    IIS 7 Settings 
        <system.webServer> 
            <validation validateIntegratedModeConfiguration="false" /> 
            <modules> 
                <add name="ErrorModule" type="TheSiteDoctor.ErrorHandling.ErrorModule, TheSiteDoctor.ErrorHandling" /> 
            </modules> 
        </system.webServer> 
    -->
    </configuration>

    Then you'll need to check all the settings -I recommend storing these in another .config file for clarities sake. Make sure you've configured your SMTP settings and you should be good to go.

    If you want to test your settings, I've included a test page for you that will check your settings and show you the defaults if you've not set them. I've got this running now on a couple of Umbraco and dasBlog installs without an issue.

    There's also a useful logging system in it which I'll look to overview in a later post but if you want to see it, check out the included aspx file.

    Download ErrorHandling_v2.0.zip (25Kb)

    If you do use this code I'd be interested to hear how you get on, I think it requires a little more refinement un some areas but it's pretty robust.

    Enjoy.

    Sunday, March 01, 2009 9:42:50 AM (GMT Standard Time, UTC+00:00)
    I'm going to try and check this out when I get the chance but historically I have used the ELMAH project for error reporting - you might want to have a look if you haven't used it before.

    http://code.google.com/p/elmah/
    Monday, June 01, 2009 12:07:39 AM (GMT Daylight Time, UTC+01:00)
    Hi Tim,

    I have recently been playing with http://www.Exceptioneer.com/ which works in the same way you have described above, it's in BETA at the moment, but the guys who have put it together have built a nice product with a very clean and crisp interface. All errors are logged on their servers, you can get email and twitter alerts and then share the errors with others using public URL's (they hide data that might be sensitive) so that you can post the errors onto forums etc to get help.

    Definitely worth a trial, it's already highlighted a couple of errors I didn't know I had on client sites and a lot of 404 errors as the client keeps changing pages and has not setup a good 404 solution ( currently doing that for them now :) )

    Cheers,

    Chris
    Name
    E-mail
    (will show your gravatar icon)
    Home page

    Comment (HTML not allowed)  

    Live Comment Preview