TraceWebEventProvider 类

定义

实现将 ASP.NET 运行状况监视事件作为跟踪消息发送的事件提供程序。Implements an event provider that sends ASP.NET health-monitoring events as trace messages.

public ref class TraceWebEventProvider sealed : System::Web::Management::WebEventProvider
public sealed class TraceWebEventProvider : System.Web.Management.WebEventProvider
type TraceWebEventProvider = class
    inherit WebEventProvider
Public NotInheritable Class TraceWebEventProvider
Inherits WebEventProvider
继承
TraceWebEventProvider

示例

下面的配置文件节选显示了如何在 healthMonitoring 部分指定 TraceWebEventProvider 类型的提供程序。The following configuration file excerpt shows how to specify a provider of type TraceWebEventProvider in the healthMonitoring section. rules 部分中的 add 元素指定提供程序将处理请求处理事件。The add element in the rules section specifies that the provider will handle request-processing events.

<healthMonitoring  
    enabled="true"  
    heartBeatInterval="0">  
    <providers>  
        <add name="TraceEventProvider"  
            type="System.Web.Management.TraceWebEventProvider,   
              System.Web"  
            buffer="false"  
            bufferMode=""  
            maxEventLength="4096"  
            maxSize="4096"  
            maxMessagesPerNotification="1"  
        />  
    </providers>  
    <eventMappings>  
        <add name="Request Processing Events"  
            type="System.Web.Management.WebRequestEvent, System.Web"   
        />  
    </eventMappings>  
    <profiles>  
        <add name="Trace"  
            minInstances="1"  
            maxLimit="Infinite"  
            minInterval="00:00:00"  
        />  
    </profiles>  
    <rules>  
        <add name="Trace Request Processing"  
            eventName="Request Processing Events"  
            provider="TraceEventProvider"  
            profile="Trace"  
        />  
   </rules>  
</healthMonitoring>   

注解

ASP.NET health monitoring 允许生产和运营人员管理已部署的 Web 应用程序。ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. System.Web.Management 命名空间包含负责打包应用程序运行状况数据的运行状况事件类型,以及负责处理此数据的提供程序类型。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.

此提供程序将事件传递给 Trace 的对象。This provider passes events to the Trace object. 它将派生自 WebBaseErrorEvent 类的事件作为跟踪错误传递,并将所有其他事件作为跟踪信息传递。It passes events that derive from the WebBaseErrorEvent class as trace errors and passes all other events as trace information.

备注

TraceWebEventProvider 对象不提供事件缓冲。The TraceWebEventProvider object does not provide event buffering.

备注

在大多数情况下,你将能够使用已实现的 ASP.NET health 监视类型,并且将通过在 "healthMonitoring 配置" 部分中指定值来控制运行状况监视系统。In most cases you will be able to use the ASP.NET health-monitoring types as implemented, and you will control the health-monitoring system by specifying values in the healthMonitoring configuration section. 还可以从运行状况监视类型派生,以创建自己的自定义事件和提供程序。You can also derive from the health-monitoring types to create your own custom events and providers. 有关创建自定义提供程序的示例,请参阅 如何:中实现运行状况监视自定义提供程序示例。For an example of creating a custom provider, see How to: Implement the Health Monitoring Custom Provider Example.

属性

Description

获取一条简短的易懂描述,它适合在管理工具或其他用户界面 (UI) 中显示。Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).

(继承自 ProviderBase)
Name

获得一个友好名称,用于在配置过程中引用提供程序。Gets the friendly name used to refer to the provider during configuration.

(继承自 ProviderBase)

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
Flush()

从提供程序的缓冲区中移除所有事件。Removes all events from the provider's buffer.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Initialize(String, NameValueCollection)

设置此对象的初始值。Sets the initial values for this object.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ProcessEvent(WebBaseEvent)

处理传递给提供程序的事件。Processes the event passed to the provider.

Shutdown()

执行与关闭提供程序相关联的任务。Performs tasks associated with shutting down the provider.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅