Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

WebEventCodes Class

Defines the codes associated with the ASP.NET health monitoring events.

Namespace: System.Web.Management
Assembly: System.Web (in system.web.dll)
public sealed class WebEventCodes
public final class WebEventCodes
public final class WebEventCodes
Not applicable.

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.

The WebEventCodes class contains codes that identify types of health-monitoring events. Two types of codes are defined within the class: major codes, which identify the ASP.NET health-monitoring events; and detail codes, which provide more information about a related major code. These codes are implemented as integers, rather than as an enumeration, to allow for extensibility.

When a health-monitoring event is raised, it is associated with a major event code. The following list identifies the categories of major event codes that are defined within the WebEventCodes class:

  • Application Codes

Application codes identify events in the lifetime of an application, such as startup and shutdown events. Their values are greater than the ApplicationCodeBase field constant. They are associated with the WebApplicationLifetimeEvent event type. The heartbeat event is a special kind of application event. It identifies events raised at periodic intervals to provide information relative to the state of the running process. It is associated with the WebHeartBeatEvent event type.

  • Request Codes

    Request codes identify non-error events that provide per-request information. Their values are greater than the RequestCodeBase field constant. They are associated with the WebRequestEvent event type.

  • Error Codes

    Error codes identify events that contain information about two kinds of errors: errors specifically related to a Web request and systemic errors. The errors related to Web requests include unhandled exceptions, view-state errors, and input-validation errors. They are associated with the WebRequestErrorEvent event type. The systemic errors relate to configuration or application code, including parser errors and compilation errors. They are associated with the WebErrorEvent event type. Both kinds of errors have values greater than the ErrorCodeBase field constant.

  • Audit Codes

    Audit codes identify events that contain auditable information such as login attempts, access security violations, and authorization violations. Their values are greater than AuditCodeBase. They are associated with WebAuditEvent and its derived event types.

  • Miscellaneous Codes.

    Miscellaneous codes do not identify events but are used to flag nonstandard event information. Their values are greater than MiscCodeBase. Refer also to WebEventProviderInformation for more information.

You can create your own custom event code by choosing code values above WebExtendedBase.

In the eventMappings health-monitoring configuration element, you can optionally specify an event-code range. If the event code range is specified, the mapping only applies to the events that have an event code within that range; otherwise, it applies to all the event codes. The following configuration file excerpt shows the EventLogWebEventProvider configured to handle WebFailureAuditEvent events whose event codes belong to the audit category.

</healthMonitoring>
  <eventMappings> 
    <add name="Failure Audits" type=
      "System.Web.Management.WebFailureAuditEvent,System.Web, Version=2.0.3600.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </eventMappings>

  <rules>
    <add name="Failure Audits Default"
      eventName="Failure Audits"
      provider="EventLogProvider"
      profile="Default"
      minInterval="00:01:00" />
  </rules>
</healthMonitoring>

You can create your own custom event code by choosing code values above WebExtendedBase.

System.Object
  System.Web.Management.WebEventCodes
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.