SqlWebEventProvider 类
定义
实现将事件通知保存到 SQL 数据库的事件提供程序。Implements an event provider that saves event notifications to an SQL database.
public ref class SqlWebEventProvider : System::Web::Management::BufferedWebEventProvider
public class SqlWebEventProvider : System.Web.Management.BufferedWebEventProvider
type SqlWebEventProvider = class
inherit BufferedWebEventProvider
Public Class SqlWebEventProvider
Inherits BufferedWebEventProvider
- 继承
示例
下面的示例演示了如何在节中指定类型为的提供程序 SqlWebEventProvider <healthMonitoring> 。The following example is a configuration file excerpt that shows how to specify a provider of type SqlWebEventProvider in the <healthMonitoring> section. <add>部分中的元素 <rules> 指定提供程序将处理审核事件。The <add> element in the <rules> section specifies that the provider will handle audit events.
<healthMonitoring
enabled="true"
heartBeatInterval="0">
<bufferModes>
<add name="Analysis"
maxBufferSize="1000"
maxFlushSize="100"
urgentFlushThreshold="100"
regularFlushInterval="00:05:00"
urgentFlushInterval="00:01:00"
maxBufferThreads="1"
/>
</bufferModes>
<providers>
<add name="SqlWebEventProvider"
type="System.Web.Management.SqlWebEventProvider,System.Web"
connectionStringName="LocalSqlServer"
maxEventDetailsLength="1073741823"
buffer="true"
bufferMode="Analysis"
/>
</providers>
<eventMappings>
<add name="All Audits"
type="System.Web.Management.WebAuditEvent, System.Web"
/>
</eventMappings>
<profiles>
<add name="Default"
minInstances="1"
maxLimit="Infinite"
minInterval="00:10:00"
/>
</profiles>
<rules>
<add name="All Audits Default"
eventName="All Audits"
provider="SqlWebEventProvider"
profile="Default"
minInterval="00:00:30"
/>
</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.
此提供程序具有一组全面的配置属性,可用于自定义其行为。This provider has a comprehensive set of configuration attributes that you can use to customize its behavior.
备注
在大多数情况下,你将能够使用已实现的 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.
构造函数
| SqlWebEventProvider() |
初始化 SqlWebEventProvider 类的新实例。Initializes a new instance of the SqlWebEventProvider class. |
属性
| BufferMode |
获取一个指示提供程序使用的缓冲模式的值。Gets a value indicating the buffering mode used by the provider. (继承自 BufferedWebEventProvider) |
| 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) |
| UseBuffering |
获取一个指示提供程序是否处于缓冲模式的值。Gets a value indicating whether the provider is in buffered mode. (继承自 BufferedWebEventProvider) |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| EventProcessingComplete(WebBaseEventCollection) |
在事件处理完成时调用。Called when event processing is complete. |
| Flush() |
将事件从提供程序缓冲区移到事件日志中。Moves the events from the provider's buffer into the event log. (继承自 BufferedWebEventProvider) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets 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. |
| ProcessEventFlush(WebEventBufferFlushInfo) |
从提供程序的缓冲区中移除所有事件。Removes all events from the provider's buffer. |
| Shutdown() |
执行与关闭提供程序相关联的任务。Performs tasks associated with shutting down the provider. |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |