WebEventProvider Class
Assembly: System.Web (in system.web.dll)
ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. The System.Web.Management namespace contains the health event types responsible for packaging application health-status data and the provider types responsible for processing this data. It also contains supporting types that help during the management of health events.
If you want to customize the health-event processing, you can derive from the WebEventProvider class to create your own custom provider.
Note: |
|---|
| In most cases you will be able to use the ASP.NET health-monitoring types as implemented, and you will control the health-monitoring system by specifying values in the healthMonitoring configuration section. You can also derive from the health-monitoring types to create your own custom events and providers. For an example of deriving from the WebEventProvider class, see the example provided in this topic. |
The following code example shows how to derive from the WebEventProvider class to create a custom provider that writes the configured events to a local file for which appropriate access rights must be granted. This custom provider example is simple and its main intent is to give you as developer full control of its basic mechanisms. In a real-world scenario, you could use this provider and especially the example buffered provider available at BufferedWebEventProvider, as a preliminary probe into the behavior of an application. This can help you during the design stage to gain an understanding of the information available; then later you can direct this information to a more complex provider.
The following configuration file excerpt shows a healthMonitoring section configuration that enables ASP.NET to use the custom provider defined above to process all health-monitoring events.
<healthMonitoring
heartBeatInterval="0"
enabled="true">
<providers>
<add name="SampleWebEventProvider"
type="SamplesAspNet.SampleEventProvider,webeventprovider, Version=1.0.1773.33989, Culture=neutral, PublicKeyToken=cf85aa6c978d9dea, processorArchitecture=MSIL" />
</providers>
<rules>
<rule
name="Custom Event Provider"
eventName="All Events"
provider="SampleWebEventProvider"
profile="Default" />
</rules>
</healthMonitoring>
System.Configuration.Provider.ProviderBase
System.Web.Management.WebEventProvider
System.Web.Management.BufferedWebEventProvider
System.Web.Management.EventLogWebEventProvider
System.Web.Management.IisTraceWebEventProvider
System.Web.Management.TraceWebEventProvider
System.Web.Management.WmiWebEventProvider
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Note: