Export (0) Print
Expand All

WebEventFormatter Class

Formats ASP.NET health monitoring event information.

System.Object
  System.Web.Management.WebEventFormatter

Namespace:  System.Web.Management
Assembly:  System.Web (in System.Web.dll)

public class WebEventFormatter

The WebEventFormatter type exposes the following members.

  NameDescription
Public propertyIndentationLevelGets or sets the indentation level.
Public propertyTabSizeGets or sets the tab size.
Top

  NameDescription
Public methodAppendLineAppends the specified string and a carriage return to the event information.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns the event information in string format.
Top

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 WebEventFormatter is a supporting type used to uniformly format event-related information, which is useful if the event data must be logged and later presented to the user..

Instances of the WebEventFormatter class are passed as arguments to the formatting methods defined by the health-event types.

The following code example shows how to use the WebEventFormatter to format event information. It is mainly intended to show the correct syntax to use. This code example is part of a larger example provided for the WebBaseEvent class.

//Formats Web request event information. 
public override void FormatCustomEventDetails(
    WebEventFormatter formatter)
{
    base.FormatCustomEventDetails(formatter);

    // Add custom data.
    formatter.AppendLine("");

    formatter.IndentationLevel += 1;

    formatter.TabSize = 4;

    formatter.AppendLine(
         "*SampleWebBaseEvent Start *");

    // Display custom event information.
    formatter.AppendLine(customCreatedMsg);
    formatter.AppendLine(customRaisedMsg);
    formatter.AppendLine(firingRecordInfo);

    formatter.AppendLine(
  "* SampleWebBaseEvent End *");


    formatter.IndentationLevel -= 1;

}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft