Date post: | 15-Jan-2015 |
Category: |
Technology |
Upload: | orbit-one-we-create-coherence |
View: | 4,173 times |
Download: | 0 times |
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
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
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
6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck4
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
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
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
6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck8
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
httpConsulting webpages
OleDb
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
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
Applications
12 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009
Web siteNotificationsRss feeds…
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
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
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
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
Demo
17 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009
Demo website
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
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
Database
6 October, 2009ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck20
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
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
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
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
www.orbitone.com
25 ELMAH Asp.NET exception logging, by Mel Gerats & Wim De Coninck6 October, 2009