This topic has not yet been rated - Rate this topic

EventRecord Class

Defines the properties of an event instance for an event that is received from an EventLogReader object. The event properties provide information about the event such as the name of the computer where the event was logged and the time the event was created. This class is an abstract class. The EventLogRecord class implements this class.

System.Object
  System.Diagnostics.Eventing.Reader.EventRecord
    System.Diagnostics.Eventing.Reader.EventLogRecord

Namespace:  System.Diagnostics.Eventing.Reader
Assembly:  System.Core (in System.Core.dll)
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public abstract class EventRecord : IDisposable

The EventRecord type exposes the following members.

  Name Description
Protected method EventRecord Initializes a new instance of the EventRecord class.
Top
  Name Description
Public property ActivityId Gets the globally unique identifier (GUID) for the activity in process for which the event is involved. This allows consumers to group related activities.
Public property Bookmark Gets a placeholder (bookmark) that corresponds to this event. This can be used as a placeholder in a stream of events.
Public property Id Gets the identifier for this event. All events with this identifier value represent the same type of event.
Public property Keywords Gets the keyword mask of the event. Get the value of the KeywordsDisplayNames property to get the name of the keywords used in this mask.
Public property KeywordsDisplayNames Gets the display names of the keywords used in the keyword mask for this event.
Public property Level Gets the level of the event. The level signifies the severity of the event. For the name of the level, get the value of the LevelDisplayName property.
Public property LevelDisplayName Gets the display name of the level for this event.
Public property LogName Gets the name of the event log where this event is logged.
Public property MachineName Gets the name of the computer on which this event was logged.
Public property Opcode Gets the opcode of the event. The opcode defines a numeric value that identifies the activity or a point within an activity that the application was performing when it raised the event. For the name of the opcode, get the value of the OpcodeDisplayName property.
Public property OpcodeDisplayName Gets the display name of the opcode for this event.
Public property ProcessId Gets the process identifier for the event provider that logged this event.
Public property Properties Gets the user-supplied properties of the event.
Public property ProviderId Gets the globally unique identifier (GUID) of the event provider that published this event.
Public property ProviderName Gets the name of the event provider that published this event.
Public property Qualifiers Gets qualifier numbers that are used for event identification.
Public property RecordId Gets the event record identifier of the event in the log.
Public property RelatedActivityId Gets a globally unique identifier (GUID) for a related activity in a process for which an event is involved.
Public property Task Gets a task identifier for a portion of an application or a component that publishes an event. A task is a 16-bit value with 16 top values reserved. This type allows any value between 0x0000 and 0xffef to be used. To obtain the task name, get the value of the TaskDisplayName property.
Public property TaskDisplayName Gets the display name of the task for the event.
Public property ThreadId Gets the thread identifier for the thread that the event provider is running in.
Public property TimeCreated Gets the time, in DateTime format, that the event was created.
Public property UserId Gets the security descriptor of the user whose context is used to publish the event.
Public property Version Gets the version number for the event.
Top
  Name Description
Public method Dispose() Releases all the resources used by this object.
Protected method Dispose(Boolean) Releases the unmanaged resources used by this object, and optionally releases the managed resources.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method FormatDescription() Gets the event message in the current locale.
Public method FormatDescription(IEnumerable<Object>) Gets the event message, replacing variables in the message with the specified values.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method ToXml Gets the XML representation of the event. All of the event properties are represented in the event XML. The XML conforms to the event schema.
Top
Note Note

The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ