EventLogReader Constructors

Definition

Initializes a new instance of the EventLogReader class.

Overloads

EventLogReader(EventLogQuery)

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

EventLogReader(String)

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

EventLogReader(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.

EventLogReader(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.

EventLogReader(EventLogQuery)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

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

C#
public EventLogReader(System.Diagnostics.Eventing.Reader.EventLogQuery eventQuery);

Parameters

eventQuery
EventLogQuery

The event query used to retrieve events.

Remarks

Use the ReadEvent method to retrieve events from this object.

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

EventLogReader(String)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

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

C#
public EventLogReader(string path);

Parameters

path
String

The name of the event log to retrieve events from.

Remarks

Use the ReadEvent method to retrieve events from this object.

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

EventLogReader(EventLogQuery, EventBookmark)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

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.

C#
public EventLogReader(System.Diagnostics.Eventing.Reader.EventLogQuery eventQuery, System.Diagnostics.Eventing.Reader.EventBookmark bookmark);
C#
[System.Security.SecurityCritical]
public EventLogReader(System.Diagnostics.Eventing.Reader.EventLogQuery eventQuery, System.Diagnostics.Eventing.Reader.EventBookmark bookmark);

Parameters

eventQuery
EventLogQuery

The event query used to retrieve events.

bookmark
EventBookmark

The bookmark (placeholder) used as a starting position in the event log or stream of events. Only events logged after the bookmark event will be returned by the query.

Attributes

Remarks

Use the ReadEvent method to retrieve events from this object.

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

EventLogReader(String, PathType)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

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.

C#
public EventLogReader(string path, System.Diagnostics.Eventing.Reader.PathType pathType);

Parameters

path
String

The name of the event log to retrieve events from, or the path to the event log file to retrieve events from.

pathType
PathType

Specifies whether the string used in the path parameter specifies the name of an event log, or the path to an event log file.

Remarks

Use the ReadEvent method to retrieve events from this object.

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9