add Element for providers for healthMonitoring (ASP.NET Settings Schema)

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

<configuration> Element
  system.web Element (ASP.NET Settings Schema)
    healthMonitoring Element (ASP.NET Settings Schema)
      providers Element for healthMonitoring (ASP.NET Settings Schema)
        add Element for providers for healthMonitoring (ASP.NET Settings Schema)

<!-- Default, WMIWebEventProvider and WebEventProvider syntax -->
<add   
   name="provider name"
   type="type reference" />

<!-- SQL Implementation Provider syntax -->
<add name="SqlEventProvider"
     type="System.Web.Management.SqlWebEventProvider, System.Web, 
Version=1.2.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
     connectionName="string"
     maxEventDetailLength="int" 
     commandTimeout="interval" 
     buffer="true|false" 
     bufferMode="string" />

<!-- Simple Mail Event and Templated Mail Web Event Providers syntax -->
<add name="MailEventProvider" 
     type="System.Web.Management.MailWebEventProvider,System.Web,
Version=%ASSEMBLY_VERSION%,Culture=neutral,PublicKeyToken=%MICROSOFT_PUBLICKEY%"
     from="string" 
     to="string, string" 
     cc="string, string" 
     bcc="string, string" 
     priority="High|Normal|Low" 
     subjectPrefix="email subject prefix" 
     bodyHeader="email body header" 
     bodyFooter="email body footer" 
     separator="string" 
     template="string" (cannot be specified with the header/footer/separator) 
     maxSizeForSimpleMessage="number" 
     maxEventLengthForSimpleMessage="number" 
     maxEventCountForTemplateMessage="number" 
     maxMessagesPerNotification="number" 
     buffer="true|false" 
     bufferMode="string" />

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

bcc

Optional String attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider classes only.

Defines a colon (,)–separated list of recipient addresses to include in the blind copy (bcc) list.

bodyFooter

Optional String attribute.

Applies to the SimpleMailWebEventProvider attributes only.

Specifies text to include at the bottom of the e-mail body in the simple e-mail format.

Note

This attribute cannot be used with the template attribute.

bodyHeader

Optional String attribute.

Applies to the SimpleMailWebEventProvider attribute only.

Specifies text to include at the top of the e-mail body in the simple e-mail format.

Note

This attribute cannot be used with the template attribute.

buffer

Required Boolean attribute.

Applies to the SqlWebEventProvider class only.

Specifies whether the provider uses buffering or immediately sends each event to the recipient.

The default is false.

bufferMode

Optional String attribute.

Applies to the SQLWebEventProvider attribute only.

Specifies the name of the buffering mode that is used by the provider, if the provider is in the buffered mode. The name must reference one of the existing buffering modes that are present in the BufferModesCollection collection;, otherwise, an exception is thrown. This attribute must be present, if buffering is turned on.

cc

Optional String attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Defines a semicolon (;)–separated list of recipient addresses to go into the copy (cc:) list.

commandTimeout

Optional Int32 attribute.

Applies to the SQLWebEventProvider attribute only.

Specifies the number of seconds before a command that is issued to the membership data source times out. This time-out is used by the SQL provider when it creates SqlCommand objects. By default, this attribute is not set in the ASP.NET configuration. Therefore, the ADO.NET default of 30 seconds is used. If this attribute is set, the SQL provider must use the configured time-out value for all SQL commands that are issued to the database. A System.Configuration.Provider.ProviderException exception is thrown, if validation fails.

The default is 30 (the ADO.NET default).

connectionStringName

Required String attribute.

Applies to the SQLWebEventProvider attribute only.

Specifies the string to use to connect to the database.

detailedTemplateErrors

Optional Boolean attribute.

Applies to the TemplatedMailWebEventProvider attribute only.

Specifies whether exception details are sent in an e-mail message when an error occurs during template compilation or run time.

The default is false.

from

Optional String attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Specifies the address of the sender.

This attribute is inherited from the SMTP mail configuration section, if it is not specified.

maxEventDetailLength

Optional Int32 attribute.

Applies to the SQLWebEventProvider attribute only.

Specifies the maximum length, in characters, of the event detail that is allowed for each event, as follows:

  • If the event detail (event.ToString()) is greater than this attribute, the event detail is truncated at the maxEventDetailLength length.

  • If 0, no detail is supplied for each event.

  • If Infinite, no maximum length check is performed and the complete detail text is included.

Note

If the event detail length is not limited, this attribute is a potential vulnerability.

maxEventLengthForSimpleMessage

Optional Int32 attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Specifies the maximum length, in characters, of the event detail that is allowed for each event, as follows:

  • If the event detail (event.ToString()) is greater than this attribute, the event detail is truncated at the maxEventLengthForSimpleMessage length.

  • If 0, no event detail is included in the notifications.

  • If Infinite, no upper bound on the event detail length is set.

Note

If the message size is not limited, this attribute is a potential vulnerability. The default is 5000 characters.

maxSizeForSimpleMessage

Optional Int32 attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Specifies the maximum size, in bytes, of the notification messages that are sent by the provider. If Infinite, no mail splitting is performed in the simple mode.

Note

This attribute can cause messages to be discarded by the e-mail system and is a potential vulnerability. The default is 1024 KB.

maxEventCountForTemplateMessage

Optional Int32 attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Specifies the maximum number of events in each notification message that is sent by the provider when in templated mode. If Infinite, no mail splitting is performed.

Note

This attribute can cause messages to be discarded by the e-mail system and is a potential vulnerability.

The default is 100.

maxMessagesPerNotification

Optional Int32 attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Specifies the maximum number of messages between which events can be split per notification. If Infinite, no limit is specified.

Note

This attribute can cause an e-mail flood and is a potential vulnerability.

The default is 100.

name

Required String attribute.

Specifies the provider-friendly name.

priority

Optional String attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Sets the priority of the e-mail messages and is a member of the MailPriority enumeration.

The default is Normal.

separator

Optional String attribute.

Applies to the SimpleMailWebEventProvider attribute only.

Specifies text to include between each event and after each section header in the simple e-mail format.

Note

This attribute cannot be used with the template attribute.

smtpAddresses

Required String attribute.

Applies to the SimpleMailWebEventProvider attribute only.

Specifies a comma-separated list of e-mail addresses to which event notifications are sent. If different sets of e-mail addresses will be used for different profiles events, multiple instances of the provider can be configured.

subjectPrefix

Optional String attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Specifies the string that gets prepended to the e-mail subject and allows the e-mail messages to have a custom subject for each instance of the provider.

Note

This attribute cannot be used with the template attribute.

template

Optional String attribute.

Applies to the TemplatedMailWebEventProvider attribute only.

Specifies the user-provided template page (.aspx) to use to create the message body for each notification.

Note

This attribute cannot be used with the bodyHeader, bodyFooter, and separator attributes.

to

Optional String attribute.

Applies to the SimpleMailWebEventProvider and TemplatedMailWebEventProvider attributes only.

Defines a semicolon-separated list of recipient addresses that will go into the to (to:) list.

type

Required String attribute.

Specifies a fully qualified assembly reference to a class that implements the System.Configuration.Provider.ProviderBase class.

Child Elements

None.

Parent Elements

Element

Description

configuration

Specifies the 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.

providers

Defines the health monitoring providers that are responsible for event processing.

Remarks

If additional name/value pairs are present, the provider must process the name/value pairs.

Default Configuration

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

<add name="EventLogProvider" type="System.Web.Management.EventLogWebEventProvider,
System.Web,Version=2.0.0.0,Culture=neutral,
     PublicKeyToken=b03f5f7f11d50a3a" />
<add ConnectionStringName="LocalSqlServer" maxEventDetailsLength="1073741823" 
     buffer="false" bufferMode="Notification" name="SqlWebEventProvider" 
     type="System.Web.Management.SqlWebEventProvider,
System.Web,Version=2.0.0.0,
     Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
<add name="WmiWebEventProvider" type="System.Web.Management.WmiWebEventProvider,
System.Web,Version=2.0.0.0,Culture=neutral,
     PublicKeyToken=b03f5f7f11d50a3a" />

Example

The following code example shows how to add a provider.

<providers>
  <add name="WmiEventProvider"
       type="System.Web.Management.WmiWebEventProvider,
     System.Web,Version=1.2.3400.0,Culture=neutral,
     PublicKeyToken=b03f5f7f11d50a3a"/>
  <add name="SampleEventProvider"     
       type="Samples.AspNet.SampleEventProvider,SampleEventProvider,
     Version=0.0.0.0,Culture=neutral,PublicKeyToken=92029af6cf75bd7c,
     ProcessorArchitecture=Neutral"/>
</providers>

Element Information

Configuration section handler

System.Web.Configuration.HealthMonitoringSection

Configuration member

HealthMonitoringSection.Providers

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 Microsoft .NET Framework 2.0

Microsoft Visual Studio 2005

See Also

Tasks

How to: Lock ASP.NET Configuration Settings

Reference

healthMonitoring Element (ASP.NET Settings Schema)

providers Element for healthMonitoring (ASP.NET Settings Schema)

remove Element for providers for healthMonitoring (ASP.NET Settings Schema)

clear Element for providers for healthMonitoring (ASP.NET Settings Schema)

WmiWebEventProvider

WebEventProvider

SimpleMailWebEventProvider

TemplatedMailWebEventProvider

SqlWebEventProvider

System.Configuration

System.Web.Configuration

System.Web.Management

Concepts

ASP.NET Health Monitoring Overview

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