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

將易記事件名稱對應至相關事件型別。

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

<eventMappings>
    <add.../>
    <remove.../>
    <clear />
</eventMappings>

屬性和項目

下列小節描述本小節所述的屬性、子項目和父項目。

屬性

無。

子項目

項目

描述

add

選擇性項目。

指定事件名稱和實作此事件的類別。

clear

選擇性項目。

移除所有的事件易記名稱對應。

remove

選擇性項目。

移除指定的事件易記名稱對應。

父項目

項目

描述

configuration

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

system.web

指定 ASP.NET 組態區段的根項目。

healthMonitoring

設定健康監視的應用程式。

備註

eventMappings 項目可讓您將易記名稱指派至事件的來源。 然後,這些名稱用於使事件來源和相關事件取用者 (稱為提供者,位於組態之 healthMonitoring 區段的 rules 項目) 產生關聯。

預設組態

下列預設 eventMappings 項目是在 .NET Framework 2.0 版中的根 Web.config 檔中設定。

<eventMappings>
      <add name="All Events" 
           type="System.Web.Management.WebBaseEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
          PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Heartbeats" 
           type="System.Web.Management.WebHeartbeatEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Application Lifetime Events" 
           type="System.Web.Management.WebApplicationLifetimeEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Request Processing Events" 
           type="System.Web.Management.WebRequestEvent, 
       System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="All Errors" 
           type="System.Web.Management.WebBaseErrorEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Infrastructure Errors" 
           type="System.Web.Management.WebErrorEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Request Processing Errors" 
           type="System.Web.Management.WebRequestErrorEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="All Audits" 
           type="System.Web.Management.WebAuditEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Failure Audits" 
           type="System.Web.Management.WebFailureAuditEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
      <add name="Success Audits" 
           type="System.Web.Management.WebSuccessAuditEvent, 
      System.Web,Version=2.0.0.0,Culture=neutral, 
           PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" />
</eventMappings>

範例

下列程式碼範例將顯示如何將事件名稱加入集合。

<eventMappings>
  <add name="SampleWebEvent"
    type= "Samples.AspNet.System.Web.Management.SampleWebEvent,
    SampleWebEvent,Version=0.0.0.0, Culture=neutral, 
    PublicKeyToken=f0c63b9a560d5e5a"/>
</eventMAppings>

項目資訊

Configuration section handler

System.Web.Configuration.HealthMonitoringSection

Configuration member

HealthMonitoringSection.EventMappings

Configurable locations

Machine.config

根層次的 Web.config

應用程式層級的 Web.config

Requirements

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 之 eventMappings 的 add 項目 (ASP.NET 設定結構描述)

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

healthMonitoring 之 eventMappings 的 clear 項目 (ASP.NET 設定結構描述)

System.Configuration

System.Web.Configuration

概念

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