Uredi

Deli z drugimi prek


SimpleMailWebEventProvider Class

Definition

Implements an event provider that sends email for event notifications.

public ref class SimpleMailWebEventProvider sealed : System::Web::Management::MailWebEventProvider
public sealed class SimpleMailWebEventProvider : System.Web.Management.MailWebEventProvider
type SimpleMailWebEventProvider = class
    inherit MailWebEventProvider
Public NotInheritable Class SimpleMailWebEventProvider
Inherits MailWebEventProvider
Inheritance

Examples

The following configuration file excerpt shows how to specify a provider of type SimpleMailWebEventProvider in the healthMonitoring section. The add elements in the rules section specify that the provider will handle request-processing errors and infrastructure errors.

<healthMonitoring  
    enabled="true"  
    heartBeatInterval="0">  
    <bufferModes>  
        <add name="Critical Notification"  
            maxBufferSize="100"  
            maxFlushSize="20"  
            urgentFlushThreshold="1"  
            regularFlushInterval="Infinite"  
            urgentFlushInterval="00:01:00"  
            maxBufferThreads="1"  
        />  
    </bufferModes>  
    <providers>  
        <add name="CriticalMailEventProvider"  
            type="System.Web.Management.SimpleMailWebEventProvider,   
              System.Web, Version=%ASSEMBLY_VERSION%, Culture=neutral,   
              PublicKeyToken=%MICROSOFT_PUBLICKEY%"  
            from="sender address"  
            to="someone@example.com"   
            cc="someone@example.com  
            bcc="someone@example.com"  
            priority="High"  
            bodyHeader="Warning!"  
            bodyFooter="Please investigate ASAP."  
            subjectPrefix="Action required."  
            buffer="true"  
            bufferMode="Critical Notification"  
            maxEventLength="4096"  
            maxSize="4096"  
            maxMessagesPerNotification="1"  
        />  
    </providers>  
    <eventMappings>  
        <add name="Request Processing Events"  
            type="System.Web.Management.WebRequestEvent, System.Web,   
              Version=%ASSEMBLY_VERSION%, Culture=neutral,   
              PublicKeyToken=%MICROSOFT_PUBLICKEY%"   
        />  
        <add name="Infrastructure Errors"  
            type="System.Web.Management.WebErrorEvent, System.Web,   
              Version=%ASSEMBLY_VERSION%, Culture=neutral,   
              PublicKeyToken=%MICROSOFT_PUBLICKEY%"   
        />  
    </eventMappings>  
    <profiles>  
        <add name="Default"  
            minInstances="1"  
            maxLimit="Infinite"  
            minInterval="00:10:00"  
        />  
        <add name="Critical"  
            minInstances="1"  
            maxLimit="1024"  
            minInterval="00:00:00"  
        />  
    </profiles>  
    <rules>  
        <add name="Request Processing Errors"  
            eventName="Request Processing Errors"  
            provider="CriticalMailEventProvider"  
            profile="Default"  
        />  
        <add name="Infrastructure Notifications"  
            eventName="Infrastructure Errors"  
            provider="CriticalMailEventProvider"  
            profile="Critical"  
        />  
   </rules>  
</healthMonitoring>   

Remarks

ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. The System.Web.Management namespace contains the health event types responsible for packaging application health-status data and the provider types responsible for processing this data. It also contains supporting types that help during the management of health events.

This class is not intended to be used from your code. It is created, configured and used by the ASP.NET health-monitoring system to send event notifications by email. You can define an event provider in a configuration file, as demonstrated in the Example section of this topic.

This provider has a comprehensive set of configuration attributes that you can use to customize the way it works.

Properties

BufferMode

Gets a value indicating the buffering mode used by the provider.

(Inherited from BufferedWebEventProvider)
Description

Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).

(Inherited from ProviderBase)
Name

Gets the friendly name used to refer to the provider during configuration.

(Inherited from ProviderBase)
UseBuffering

Gets a value indicating whether the provider is in buffered mode.

(Inherited from BufferedWebEventProvider)

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Flush()

Moves the events from the provider's buffer into the event log.

(Inherited from BufferedWebEventProvider)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
Initialize(String, NameValueCollection)

Sets the initial values for this object.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ProcessEvent(WebBaseEvent)

This API supports the product infrastructure and is not intended to be used directly from your code.

Processes the event passed to the provider.

(Inherited from MailWebEventProvider)
ProcessEventFlush(WebEventBufferFlushInfo)

This API supports the product infrastructure and is not intended to be used directly from your code.

Removes all events from the provider's buffer.

(Inherited from MailWebEventProvider)
Shutdown()

This API supports the product infrastructure and is not intended to be used directly from your code.

Performs tasks associated with shutting down the provider.

(Inherited from MailWebEventProvider)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also