Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ClearEventLog function

Clears the specified event log, and optionally saves the current copy of the log to a backup file.

Syntax


BOOL ClearEventLog(
  _In_  HANDLE hEventLog,
  _In_  LPCTSTR lpBackupFileName
);

Parameters

hEventLog [in]

A handle to the event log to be cleared. The OpenEventLog function returns this handle.

lpBackupFileName [in]

The absolute or relative path of the backup file. If this file already exists, the function fails.

If the lpBackupFileName parameter is NULL, the event log is not backed up.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. The ClearEventLog function can fail if the event log is empty or the backup file already exists.

Remarks

After this function returns, any handles that reference the cleared event log cannot be used to read the log.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winbase.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

Unicode and ANSI names

ClearEventLogW (Unicode) and ClearEventLogA (ANSI)

See also

Event Logging Functions
OpenEventLog

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.