EventLogReader Class

 

Enables you to read events from an event log based on an event query. The events that are read by this object are returned as EventRecord objects.

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

System.Object
  System.Diagnostics.Eventing.Reader.EventLogReader

[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public class EventLogReader : IDisposable

NameDescription
System_CAPS_pubmethodEventLogReader(EventLogQuery)

Initializes a new instance of the EventLogReader class by specifying an event query.

System_CAPS_pubmethodEventLogReader(EventLogQuery, EventBookmark)

Initializes a new instance of the EventLogReader class by specifying an event query and a bookmark that is used as starting position for the query.

System_CAPS_pubmethodEventLogReader(String)

Initializes a new instance of the EventLogReader class by specifying an active event log to retrieve events from.

System_CAPS_pubmethodEventLogReader(String, PathType)

Initializes a new instance of the EventLogReader class by specifying the name of an event log to retrieve events from or the path to a log file to retrieve events from.

NameDescription
System_CAPS_pubpropertyBatchSize

Gets or sets the number of events retrieved from the stream of events on every read operation.

System_CAPS_pubpropertyLogStatus

Gets the status of each event log or log file associated with the event query in this object.

NameDescription
System_CAPS_pubmethodCancelReading()

Cancels the current query operation.

System_CAPS_pubmethodDispose()

Releases all the resources used by this object.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by this object, and optionally releases the managed resources.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodReadEvent()

Reads the next event that is returned from the event query in this object.

System_CAPS_pubmethodReadEvent(TimeSpan)

Reads the next event that is returned from the event query in this object.

System_CAPS_pubmethodSeek(EventBookmark)

Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event. No events logged before the bookmark event will be retrieved.

System_CAPS_pubmethodSeek(EventBookmark, Int64)

Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event and an offset number of events from the bookmark. No events logged before the bookmark plus the offset will be retrieved.

System_CAPS_pubmethodSeek(SeekOrigin, Int64)

Changes the position in the event stream where the next event that is read will come from by specifying a starting position and an offset from the starting position. No events logged before the starting position plus the offset will be retrieved.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

For example code using this class, see How To: Query for Events or How To: Access and Read Event Information.

.NET Framework
Available since 3.5

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

System.Diagnostics.Eventing.Reader Namespace
Technology Summary for Reading and Managing Event Logs
Event Log Scenarios

Return to top
Show: