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/
1. www.orbitone.com
Raas van Gaverestraat 83
B-9000 GENT, Belgium
E-mail info@orbitone.com
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
2. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck
In this presentation
What is ELMAH
Why use it
ASP.NET Exception Reporter
3. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck3
What is ELMAH
Open source project
http://code.google.com/p/elmah/
Error Logging Modules And Handlers
Plug and play
5. 6 October, 2009
ELMAH 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 sites
web services
.net 1.x, 2.0, 3.x
SharePoint
6. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6
Limitations
One instance web application
Overview through HttpHandler (elmah.axd)
Only limited reporting
7. 6 October, 2009
ELMAH 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
9. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck9
Architecture
SQL server
ELMAH
Database
Developers
Administrators
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
Exceptions
In XML format
Filesystem
Directory watcher
Agent
OleDb
OleDbHttps
OleDb
Email
http
Consulting webpages
OleDb
10. 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, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck10
Web Server
11. Web Service receives error
Add classification, levels, metadata
Save to database
Receive heartbeats from agents
6 October, 2009
ELMAH 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
http
Consulting webpages
12. Applications
12 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck
6 October, 2009
Web site
Notifications
Rss feeds
…
13. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck13
ELMAH HttpModule
When an error happens:
Save all information
Server variables
Client information
Form variables
The original error page
Saved as xml to a “Logs” folder
Redirect to custom error page
14. 6 October, 2009
ELMAH 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
15. 6 October, 2009
ELMAH 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 rules
Example: “user agent contains “robot” => level 0
Give error a classification, based on rules
Example: “remote address contains “192.168” => internal user
Saves the error to the database
Keeps track of the status of each agent based on heartbeats
16. Web Site
16 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck
6 October, 2009
Last 100 Errors
Search
Error id
Time frame
Application
Error message
Filters
Level
Type
User type
Application health status
Agents status
17. Demo
17 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck
6 October, 2009
Demo website
18. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck18
Notifications
Daily report:
overview of latest errors
Applications with the most errors
Possibilities:
Instant notifications when certain events occur
Lots of errors at a short interval
Same error over and over
Patterns
19. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck19
Technologies used
SQL Server
Data store
LinqToSQL
Data access
ASP.NET, JQuery
Website
Web Services
Central access point
Windows services
Agents
Scheduled Tasks
Notifications
21. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck21
Data Access
OrbitOne.Base, ORM built on top of Nhibernate
Custom
Slow
No Linq support
Nhibernate 2.1, with Linq provider
Unfinished
Strange results
LinqToSQL
Fast!
Easy
22. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck22
Technologies used
XML Data Type in SQL server
index on xml fields
23. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck23
Error filter rules
Xpath selector
/error[@detail[contains(.,'General network error')]]
Error Filter Rule
Level = 0
Type = 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
24. 6 October, 2009
ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck24
Resources
Orbit One ASP.NET Exception Reporter on Codeplex
http://aspexceptionreporter.codeplex.com
ELMAH on Google Code
http://code.google.com/p/elmah/
Documentation
http://aspexceptionreporter.codeplex.com/documentation
ELMAH @ StackOverflow
http://stackoverflow.com/questions/tagged/elmah