healthMonitoring 的 rules 元素(ASP.NET 设置架构)

[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]

将事件映射到提供程序。

此元素是 .NET Framework 2.0 版中的新元素。

<rules>
  <add... />
  <remove... /> 
  <clear/>
</rules>

特性和元素

以下几节描述了特性、子元素和父元素。

特性

无。

子元素

元素

说明

add

可选元素。

将事件映射到它的提供程序。

clear

可选元素。

移除所有规则。

remove

可选元素。

移除指定的规则。

父元素

元素

说明

configuration

指定公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中均需要的根元素。

system.web

为 ASP.NET 配置节指定根元素。

healthMonitoring

针对运行状况监视配置应用程序。

备注

默认配置

下面的默认 rules 元素在 .NET Framework 版本 2.0 的根 Web.config 文件中配置。

<rules>
     <add name="All Errors Default" eventName="All Errors" provider="EventLogProvider" profile="Default" 
          minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom="" />
     <add name="Failure Audits Default" eventName="Failure Audits" provider="EventLogProvider" 
          profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom="" />
</rules>

示例

下面的代码示例演示如何配置运行状况监视规则。

<healthMonitoring heartBeatInterval="0">

  <!-- Define the rules -->
  <rules>
    <add name="Sample Web Requests"
      eventName="SampleWebRequests"
      provider="SampleEventProvider"
      profile="Default"
      minInterval="00:01:00" />

    <add name="Standard Web Requests"
      eventName="All Events"
      provider="SampleEventProvider"
      profile="Default"
      minInterval="00:01:00" />
  </rules>

</healthMonitoring>

元素信息

配置节处理程序

System.Web.Configuration.HealthMonitoringSection

配置成员

HealthMonitoringSection.Rules

可配置的位置

Machine.config

根级别的 Web.config

应用程序级别的 Web.config

要求

Microsoft Internet 信息服务 (IIS) 版本 5.0、5.1 或 6.0

.NET Framework 2.0 版

Microsoft Visual Studio 2005

请参见

任务

How to: Lock ASP.NET Configuration Settings

参考

healthMonitoring 元素(ASP.NET 设置架构)

healthMonitoring 的 rules 的 add 元素(ASP.NET 设置架构)

healthMonitoring 的 rules 的 remove 元素(ASP.NET 设置架构)

healthMonitoring 的 rules 的 clear 元素(ASP.NET 设置架构)

System.Configuration

System.Web.Configuration

概念

ASP.NET Health Monitoring Overview

ASP.NET Configuration Overview

ASP.NET Server Controls and Browser Capabilities

Securing Configuration

Configuration Inheritance

其他资源

ASP.NET Configuration Files

ASP.NET 配置设置

常规配置设置 (ASP.NET)

ASP.NET Configuration API