Original address: Http://aspnet.4guysfromrolla.com/articles/031407-1.aspx
Introduced
asp.net 2.0 's health monitoring system is used to monitor the operating conditions of ASP.net programs in the operating environment. It works by logging event information to the specified log source. The. NET 2.0 framework contains several built-in events that can be used by health monitoring systems to monitor the start and stop of a program, unhandled exceptions, information about failed validation, and so on. NET Framework also provides a way to record these events, and you can log these event information to the Windows event log, Microsoft SQL Server database, WMI, email, or asp.net page tracking system. In the previous article we saw (translator: Chinese here) that when using a Out-of-the-box event and log source, the health monitoring system can work properly without writing any code, as long as the web.config is configured.
In this article, we will continue to study the embedded event and log sources. Specifically, we will learn how to use the Webfailureauditevent event, which triggers the event when a security audit fails. We will also know how to use Simplemailwebeventprovider, as the name implies, is to send event information via email. Keep looking down and you'll know more!
Monitoring security Audits
In the previous article, we have discussed that all health monitoring systems use events that must be inherited from the WebBaseEvent class. In the System.Web.Management namespace, you will find that there are many different subclasses of the WebBaseEvent class, and there are different types of events in different subclasses. The following figure allows you to quickly understand the hierarchical relationships of events. It shows some (not all) of the built-in events in the health monitoring system. The dark green is the event associated with security audits, which we will explore together in this article.
To enable the health monitoring system to record these events, we need to configure <eventMappings> and <rules> under the