Share via


healthMonitoring 的 rules 項目 (ASP.NET 設定結構描述)

將事件對應至提供者。

這個項目是 .NET Framework 2.0 版中新增的項目。

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

屬性和項目

下列章節會說明屬性、子項目和父項目。

屬性

無。

子項目

項目

描述

add

選擇性項目。

將事件對應至其提供者。

clear

選擇性項目。

移除所有規則。

remove

選擇性項目。

移除指定規則。

父項目

項目

描述

configuration

指定 Common Language Runtime 和 .NET Framework 應用程式所使用之每個組態檔中需要的根項目 (Root Element)。

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 Information Services (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 規則的 add 項目 (ASP.NET 設定結構描述)

healthMonitoring 規則的 remove 項目 (ASP.NET 設定結構描述)

healthMonitoring 規則的 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