Share via


eventMappings Element for healthMonitoring (ASP.NET Settings Schema)

Maps friendly event names to the related event types.

This element is new in the .NET Framework version 2.0.

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

Attributes and Elements

The following sections describe attributes, child elements, and parent elements for this section.

Attributes

None.

Child Elements

Element Description

add

Optional element.

Specifies the name of the event and the class that implements the event.

clear

Optional element.

Removes all event friendly name mappings.

remove

Optional element.

Removes the specified event friendly name mapping.

Parent Elements

Element Description

configuration

Specifies the required root element in every configuration file that is used by the common language runtime and the .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration section.

healthMonitoring

Configures an application for health monitoring.

Remarks

The eventMappings element lets you assign friendly names to event sources. These names are then used to associate event sources with the related event consumers, which are called providers, in the rules element of the healthMonitoring section of the configuration.

Default Configuration

The following default eventMappings element is configured in the root Web.config file in the .NET Framework version 2.0.

<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>

Example

The following code example shows how to add an event name to the collection.

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

Element Information

Configuration section handler

System.Web.Configuration.HealthMonitoringSection

Configuration member

System.Web.Configuration.HealthMonitoringSection.EventMappings

Configurable locations

Machine.config

Root-level Web.config

Application-level Web.config

Requirements

Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0

The .NET Framework version 2.0

Microsoft Visual Studio 2005

See Also

Tasks

How to: Lock ASP.NET Configuration Settings

Reference

healthMonitoring Element (ASP.NET Settings Schema)
add Element for eventMappings for healthMonitoring (ASP.NET Settings Schema)
remove Element for eventMappings for healthMonitoring (ASP.NET Settings Schema)
clear Element for eventMappings for healthMonitoring (ASP.NET Settings Schema)
System.Configuration
System.Web.Configuration

Concepts

ASP.NET Configuration Overview
ASP.NET Web Server Controls and Browser Capabilities
Securing ASP.NET Configuration
ASP.NET Configuration Scenarios

Other Resources

ASP.NET Configuration Files
ASP.NET Configuration Settings
General Configuration Settings (ASP.NET)
ASP.NET Configuration API