Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
EventLogRecord Class

EventLogRecord Class

Contains 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 that the event was created.


Namespace:  System.Diagnostics.Eventing.Reader
Assembly:  System.Core (in System.Core.dll)

[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public class EventLogRecord : EventRecord

The EventLogRecord type exposes the following members.

Public propertyActivityIdGets the globally unique identifier (GUID) for the activity in process for which the event is involved. This allows consumers to group related activities. (Overrides EventRecord.ActivityId.)
Public propertyBookmarkGets a placeholder (bookmark) that corresponds to this event. This can be used as a placeholder in a stream of events. (Overrides EventRecord.Bookmark.)
Public propertyContainerLogGets the name of the event log or the event log file in which the event is stored.
Public propertyIdGets the identifier for this event. All events with this identifier value represent the same type of event. (Overrides EventRecord.Id.)
Public propertyKeywordsGets the keyword mask of the event. Get the value of the KeywordsDisplayNames property to get the name of the keywords used in this mask. (Overrides EventRecord.Keywords.)
Public propertyKeywordsDisplayNamesGets the display names of the keywords used in the keyword mask for this event. (Overrides EventRecord.KeywordsDisplayNames.)
Public propertyLevelGets 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. (Overrides EventRecord.Level.)
Public propertyLevelDisplayNameGets the display name of the level for this event. (Overrides EventRecord.LevelDisplayName.)
Public propertyLogNameGets the name of the event log where this event is logged. (Overrides EventRecord.LogName.)
Public propertyMachineNameGets the name of the computer on which this event was logged. (Overrides EventRecord.MachineName.)
Public propertyMatchedQueryIdsGets a list of query identifiers that this event matches. This event matches a query if the query would return this event.
Public propertyOpcodeGets 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. (Overrides EventRecord.Opcode.)
Public propertyOpcodeDisplayNameGets the display name of the opcode for this event. (Overrides EventRecord.OpcodeDisplayName.)
Public propertyProcessIdGets the process identifier for the event provider that logged this event. (Overrides EventRecord.ProcessId.)
Public propertyPropertiesGets the user-supplied properties of the event. (Overrides EventRecord.Properties.)
Public propertyProviderIdGets the globally unique identifier (GUID) of the event provider that published this event. (Overrides EventRecord.ProviderId.)
Public propertyProviderNameGets the name of the event provider that published this event. (Overrides EventRecord.ProviderName.)
Public propertyQualifiersGets qualifier numbers that are used for event identification. (Overrides EventRecord.Qualifiers.)
Public propertyRecordIdGets the event record identifier of the event in the log. (Overrides EventRecord.RecordId.)
Public propertyRelatedActivityIdGets a globally unique identifier (GUID) for a related activity in a process for which an event is involved. (Overrides EventRecord.RelatedActivityId.)
Public propertyTaskGets 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. For the name of the task, get the value of the TaskDisplayName property. (Overrides EventRecord.Task.)
Public propertyTaskDisplayNameGets the display name of the task for the event. (Overrides EventRecord.TaskDisplayName.)
Public propertyThreadIdGets the thread identifier for the thread that the event provider is running in. (Overrides EventRecord.ThreadId.)
Public propertyTimeCreatedGets the time, in DateTime format, that the event was created. (Overrides EventRecord.TimeCreated.)
Public propertyUserIdGets the security descriptor of the user whose context is used to publish the event. (Overrides EventRecord.UserId.)
Public propertyVersionGets the version number for the event. (Overrides EventRecord.Version.)

Public methodDispose()Releases all the resources used by this object. (Inherited from EventRecord.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by this object, and optionally releases the managed resources. (Overrides EventRecord.Dispose(Boolean).)
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 methodFormatDescription()Gets the event message in the current locale. (Overrides EventRecord.FormatDescription().)
Public methodFormatDescription(IEnumerable<Object>)Gets the event message, replacing variables in the message with the specified values. (Overrides EventRecord.FormatDescription(IEnumerable<Object>).)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetPropertyValuesGets the enumeration of the values of the user-supplied event properties, or the results of XPath-based data if the event has XML representation.
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 a string that represents the current object. (Inherited from Object.)
Public methodToXmlGets the XML representation of the event. All of the event properties are represented in the event's XML. The XML conforms to the event schema. (Overrides EventRecord.ToXml().)


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.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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