asp.net exception reporter

25
www.orbitone.com Raas van Gaverestraat 83 B-9000 GENT, Belgium E-mail [email protected] Website www.orbitone.com Tel. +32 9 265 74 20 Fax +32 9 265 74 10 VAT BE 456.457.353 Bank 442-7059001-50 (KBC) 6 October, 2009 ASP.NET Exception Reporter by Mel Gerats & Wim De Coninck

Upload: orbit-one-we-create-coherence

Post on 15-Jan-2015

4.177 views

Category:

Technology


0 download

DESCRIPTION

The ASP.NET Exception Reporter is an exception handling and reporting tool developed by Orbit One. It is based on the ELMAH open source project and adds rich reporting and notification possibilities as well as strong exception aggregation and classification. The application is open source and can be found on http://aspexceptionreporter.codeplex.com/

TRANSCRIPT

Page 1: Asp.net exception reporter

www.orbitone.com

Raas van Gaverestraat 83B-9000 GENT, Belgium E-mail [email protected] Website www.orbitone.com

Tel. +32 9 265 74 20Fax +32 9 265 74 10VAT BE 456.457.353Bank 442-7059001-50 (KBC)

6 October, 2009 ASP.NET Exception Reporterby Mel Gerats & Wim De Coninck

Page 2: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck

In this presentation

What is ELMAH Why use it ASP.NET Exception Reporter

Page 3: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck3

What is ELMAH

Open source projecthttp://code.google.com/p/elmah/

Error Logging Modules And Handlers

Plug and play

Page 4: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck4

Page 5: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck5

Why use ELMAH

Track and analyze unhandled exceptions Solve errors before they are reported Keep track of errors over time Can be added to existing web sites without changing code Show friendly error page but save the error somewhere Compatible with

web sitesweb services.net 1.x, 2.0, 3.xSharePoint

Page 6: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6

Limitations

One instance web application Overview through HttpHandler (elmah.axd) Only limited reporting

Page 7: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck7

What we needed

Exceptions always saved! Central reporting website for all applications Notifications Additional filters and classification Installation on remote servers with no direct access to our database

Page 8: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck8

Page 9: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck9

Architecture

SQL server

ELMAHDatabase

DevelopersAdministrators

ELMAH notification server

SEP

13

Windows scheduled task

Starts the email notifier command line application:- every 30 minutes - daily at 20 PM

Intelligent Error Filter- Error level (0-5)-Error type (Infrastructure / Code)

ELMAH web service

ELMAH Web server

Web interface

ELMAH HttpModule

XML Folder

Web server(s)

Exceptions Exceptions Exceptions Exceptions Exceptions Exceptions

Custom error Page

Redirect to

ExceptionsIn XML format

FilesystemDirectory watcher

Agent

OleDb

OleDbHttps

OleDb

Email

httpConsulting webpages

OleDb

Page 10: Asp.net exception reporter

HttpModule deployed per application or server wide

Configured in web.config or machine.config

Error files to central folder on file

system

Agents monitor file system folder.

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck10

Web Server

Page 11: Asp.net exception reporter

Web Service receives error

Add classification, levels, metadata

Save to database

Receive heartbeats from agents

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck11

Web service

Intelligent Error Filter- Error level (0-5)-Error type (Infrastructure / Code)

ELMAH web service

ELMAH Web server

Web interface OleDb

Https

OleDb

httpConsulting webpages

Page 12: Asp.net exception reporter

Applications

12 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009

Web siteNotificationsRss feeds…

Page 13: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck13

ELMAH HttpModule

When an error happens:Save all information

Server variablesClient informationForm variablesThe original error page

Saved as xml to a “Logs” folder

Redirect to custom error page

Page 14: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck14

Agent

Installed on web server as a windows service

Monitors the “Logs” folder on the file system

Sends errors to the web service for processing

Saves errors that cannot be processed to an “invalid errors” folder

Sends a heartbeat every x minutes

Page 15: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck15

Web service

Receives errors from all agents Calculate error level, based on rules

Final level = average level of all applied rulesExample: “user agent contains “robot” => level 0

Give error a classification, based on rulesExample: “remote address contains “192.168” => internal user

Saves the error to the database

Keeps track of the status of each agent based on heartbeats

Page 16: Asp.net exception reporter

Web Site

16 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009

Last 100 Errors Search

Error idTime frameApplicationError message

FiltersLevelTypeUser type

Application health status Agents status

Page 17: Asp.net exception reporter

Demo

17 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009

Demo website

Page 18: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck18

Notifications

Daily report: overview of latest errorsApplications with the most errors

Possibilities: Instant notifications when certain events occur

Lots of errors at a short intervalSame error over and overPatterns

Page 19: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck19

Technologies used

SQL ServerData store

LinqToSQLData access

ASP.NET, JQueryWebsite

Web ServicesCentral access point

Windows servicesAgents

Scheduled TasksNotifications

Page 20: Asp.net exception reporter

Database

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck20

Page 21: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck21

Data Access

OrbitOne.Base, ORM built on top of NhibernateCustomSlowNo Linq support

Nhibernate 2.1, with Linq providerUnfinishedStrange results

LinqToSQLFast!Easy

Page 22: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck22

Technologies used

XML Data Type in SQL server index on xml fields

Page 23: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck23

Error filter rules

Xpath selector/error[@detail[contains(.,'General network error')]]

Error Filter RuleLevel = 0Type = Infrastructure

Rule can have multiple selectors, is applied when one is applicable All rules are applied on all errors Final level is the average level

Page 24: Asp.net exception reporter

6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck24

Resources

Orbit One ASP.NET Exception Reporter on Codeplexhttp://aspexceptionreporter.codeplex.com

ELMAH on Google Codehttp://code.google.com/p/elmah/

Documentationhttp://aspexceptionreporter.codeplex.com/documentation

ELMAH @ StackOverflowhttp://stackoverflow.com/questions/tagged/elmah

Page 25: Asp.net exception reporter

www.orbitone.com

25 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009