EventLogSession
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.
Gets a static predefined session object that is connected to the Event Log service on the local computer.
public EventLogSession()
Initializes a new EventLogSession object, establishes a connection with the local Event Log service.
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.
public EventLogSession(string server, string domain, string user, SecureString password, SessionAuthentication logOnType)
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.
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.
Clears events from the specified event log.
Clears events from the specified event log, and saves the cleared events to the specified file.
Releases all the resources used by this object.
Releases the unmanaged resources used by this object, and optionally releases the managed resources.
Exports events into an external log file. The events are stored without the event messages.
public void ExportLog(string path, PathType pathType, string query, string targetFilePath, bool tolerateQueryErrors)
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.
public void ExportLogAndMessages(string path, PathType pathType, string query, string targetFilePath)
Exports events and their messages into an external log file.
public void ExportLogAndMessages(string path, PathType pathType, string query, string targetFilePath, bool tolerateQueryErrors, CultureInfo targetCultureInfo)
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.
Gets an object that contains runtime information for the specified event log.
Gets an enumerable collection of all the event log names that are registered with the Event Log service.
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.