EventLogSession.ExportLogAndMessages EventLogSession.ExportLogAndMessages EventLogSession.ExportLogAndMessages Method

Definition

Exports events and their messages into an external log file.

Overloads

ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String)

Exports events and their messages into an external log file.

ExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo) ExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo) ExportLogAndMessages(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.

ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String)

Exports events and their messages into an external log file.

public:
 void ExportLogAndMessages(System::String ^ path, System::Diagnostics::Eventing::Reader::PathType pathType, System::String ^ query, System::String ^ targetFilePath);
public void ExportLogAndMessages (string path, System.Diagnostics.Eventing.Reader.PathType pathType, string query, string targetFilePath);
member this.ExportLogAndMessages : string * System.Diagnostics.Eventing.Reader.PathType * string * string -> unit

Parameters

path
String String String

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

pathType
PathType 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.

query
String String String

The query used to select the events to export. Only the events returned from the query will be exported.

targetFilePath
String String String

The path to the log file (ends in .evtx) in which the exported events will be stored after this method is executed.

Examples

For example code using this class, see How to: Export, Archive, and Clear Event Logs.

Remarks

The event messages are exported in the default language.

See also

ExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo) ExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo) ExportLogAndMessages(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.

public:
 void ExportLogAndMessages(System::String ^ path, System::Diagnostics::Eventing::Reader::PathType pathType, System::String ^ query, System::String ^ targetFilePath, bool tolerateQueryErrors, System::Globalization::CultureInfo ^ targetCultureInfo);
public void ExportLogAndMessages (string path, System.Diagnostics.Eventing.Reader.PathType pathType, string query, string targetFilePath, bool tolerateQueryErrors, System.Globalization.CultureInfo targetCultureInfo);
member this.ExportLogAndMessages : string * System.Diagnostics.Eventing.Reader.PathType * string * string * bool * System.Globalization.CultureInfo -> unit

Parameters

path
String String String

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

pathType
PathType 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.

query
String String String

The query used to select the events to export. Only the events returned from the query will be exported.

targetFilePath
String String String

The path to the log file (ends in .evtx) in which the exported events will be stored after this method is executed.

tolerateQueryErrors
Boolean Boolean Boolean

true indicates that the method will continue exporting events even if the specified query fails for some logs, and false indicates that this method will not continue to export events when the specified query fails.

targetCultureInfo
CultureInfo CultureInfo CultureInfo

The culture that specifies which language that the exported event messages will be in.

Examples

For example code using this class, see How to: Export, Archive, and Clear Event Logs.

See also

Applies to