EventLogSession.ClearLog Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Clears events from the specified event log.
Overloads
ClearLog(String) |
Clears events from the specified event log. |
ClearLog(String, String) |
Clears events from the specified event log, and saves the cleared events to the specified file. |
Examples
For example code using this class, see How To: Export, Archive, and Clear Event Logs.
ClearLog(String)
- Source:
- EventLogSession.cs
- Source:
- EventLogSession.cs
Clears events from the specified event log.
public:
void ClearLog(System::String ^ logName);
public void ClearLog (string logName);
member this.ClearLog : string -> unit
Public Sub ClearLog (logName As String)
Parameters
- logName
- String
The name of the event log to clear all the events from.
Examples
For example code using this class, see How To: Export, Archive, and Clear Event Logs.
See also
Applies to
ClearLog(String, String)
- Source:
- EventLogSession.cs
- Source:
- EventLogSession.cs
Clears events from the specified event log, and saves the cleared events to the specified file.
public:
void ClearLog(System::String ^ logName, System::String ^ backupPath);
public void ClearLog (string logName, string backupPath);
member this.ClearLog : string * string -> unit
Public Sub ClearLog (logName As String, backupPath As String)
Parameters
- logName
- String
The name of the event log to clear all the events from.
- backupPath
- String
The path to the file in which the cleared events will be saved. The file should end in .evtx.
Examples
For example code using this class, see How To: Export, Archive, and Clear Event Logs.