EventLogSession Class

 

Used to access the Event Log service on the local computer or a remote computer so you can manage and gather information about the event logs and event providers on the computer.

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

System.Object
  System.Diagnostics.Eventing.Reader.EventLogSession

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

NameDescription
System_CAPS_pubmethodEventLogSession()

Initializes a new EventLogSession object, establishes a connection with the local Event Log service.

System_CAPS_pubmethodEventLogSession(String)

Initializes a new EventLogSession object, and establishes a connection with the Event Log service on the specified computer. The credentials (user name and password) of the user who calls the method is used for the credentials to access the remote computer.

System_CAPS_pubmethodEventLogSession(String, String, String, SecureString, SessionAuthentication)

Initializes a new EventLogSession object, and establishes a connection with the Event Log service on the specified computer. The specified credentials (user name and password) are used for the credentials to access the remote computer.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticGlobalSession

Gets a static predefined session object that is connected to the Event Log service on the local computer.

NameDescription
System_CAPS_pubmethodCancelCurrentOperations()

Cancels any operations (such as reading an event log or subscribing to an event log) that are currently active for the Event Log service that this session object is connected to.

System_CAPS_pubmethodClearLog(String)

Clears events from the specified event log.

System_CAPS_pubmethodClearLog(String, String)

Clears events from the specified event log, and saves the cleared events to the specified file.

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_pubmethodExportLog(String, PathType, String, String)

Exports events into an external log file. The events are stored without the event messages.

System_CAPS_pubmethodExportLog(String, PathType, String, String, Boolean)

Exports events into an external log file. A flag can be set to indicate that the method will continue exporting events even if the specified query fails for some logs. The events are stored without the event messages.

System_CAPS_pubmethodExportLogAndMessages(String, PathType, String, String)

Exports events and their messages into an external log file.

System_CAPS_pubmethodExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo)

Exports events and their messages into an external log file. A flag can be set to indicate that the method will continue exporting events even if the specified query fails for some logs. The event messages are exported in the specified language.

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_pubmethodGetLogInformation(String, PathType)

Gets an object that contains runtime information for the specified event log.

System_CAPS_pubmethodGetLogNames()

Gets an enumerable collection of all the event log names that are registered with the Event Log service.

System_CAPS_pubmethodGetProviderNames()

Gets an enumerable collection of all the event provider names that are registered with the Event Log service. An event provider is an application that publishes events to an event log.

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_pubmethodToString()

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

For example code using this class, see How To: Query for Events, How to: Retrieve Information About an Event Publisher or How to: Configure and Read Event Log Properties.

.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: