Health Monitoring and Web Events


ASP.NET 2.0 includes a new feature called health monitoring that allows system administrators to monitor the status of running Web applications. The goal of the health monitoring subsystem is to help keep applications running smoothly, and when problems do occur, to make diagnosing those problems much easier.

To support this feature, the ASP.NET team built a sophisticated provider model for recording events as they occur in an application. The key abstraction here is something called a Web event. Each Web event is represented by a class, and several built-in Web event classes ship with ASP.NET out of the box. You can create your own custom events as well, as we'll show later in this chapter.

The ASP.NET infrastructure raises Web events when interesting things happen, and your application can raise custom Web events programmatically. By default, the health monitoring system is disabled and so these events are ignored. But once you enable health monitoring via configuration, you get to choose one or more providers that will record Web events as they occur. For example, you might choose to record certain events in the Windows event log while recording other events into a SQL database.

The idea behind this type of infrastructure isn't new. In ASP.NET 1.x, people used tools like the Logging Application Block, Enterprise Library, and log4net to build configurable event logging systems.[1] Now with Web events, you aren't forced to use add-ons like this.

[1] You can find the patterns & practices Enterprise Library at http://msdn.microsoft.com/library/en-us/dnpag2/html/entlib.asp, and the open source log4net project at http://logging.apache.org/log4net/.




Essential ASP. NET 2.0
Essential ASP.NET 2.0
ISBN: 0321237706
EAN: 2147483647
Year: 2006
Pages: 104

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net