Extending ASP.NET Health Monitoring
The classes associated with ASP.NET health monitoring are contained in the System.Web.Management namespace. They are divided into two parts: Web event classes (also known as health events), and provider classes. Web event classes are responsible for packaging Web event information. Provider classes listen for and consume the Web events and deliver the data. The System.Web.Management namespace also contains supporting classes that help during the management of Web events. ASP.NET health monitoring uses a subscriber/provider model to provide event notifications. For more information, see ASP.NET Health Monitoring Overview.
Extensibility Options
Developers can perform any or all of the following tasks to extend ASP.NET health monitoring features:
Create a custom Web event class by inheriting from the standard Web event types. Note that if your application inherits from WebBaseEvent or WebBaseErrorEvent it must run in partial trust. For all other events it must run in full trust. To add custom data to a custom event, override the FormatCustomEventDetails method. Do not override the ToString method. This is to avoid overwriting or tampering with sensitive system information. Custom events must be explicitly raised by calling the Raise method. (Standard events can only be raised by ASP.NET.) For code examples, see How to: Implement and Raise Custom ASP.NET Health Monitoring Events.
Customize a standard event type by creating a class that implements the IWebEventCustomEvaluator interface.
Create a custom provider to process an event by creating a class that inherits the WebEventProvider or BufferedWebEventProvider class. If your provider performs logging, you can also use the WebEventFormatter class. Custom event providers can be used to log events to a custom log file, send event data to third-party applications, and so on. For code examples, see How to: Implement the Health Monitoring Custom Provider Example.
See Also
Tasks
Walkthrough: Listening for WMI Events in ASP.NET Health Monitoring
Concepts
ASP.NET Health Monitoring Overview
Implementing Custom ASP.NET Health Monitoring Events and Providers
Configuring ASP.NET Health Monitoring