The NetErrorLogClear API clears (and optionally saves) the error log file of a computer.
Restrictions
This API can be called from DLS and OS/2 workstations, but DLS workstations can issue this call only to a remote LAN Server workstation. Administrator authority is required to call this API.
#include <netcons.h> #include <errlog.h> NetErrorLogClear(pszServername, pszBackupFile, reserved); /* 16 bit */ Net32ErrorLogClear(pszServername, pszBackupFile, reserved); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
pszBackupFile
A null pointer indicates that NetErrorLogClear is not to save the error log entries.
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌─────────────────────────────┬───────┬────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_PATH_NOT_FOUND │ 3 │ The path was not found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NOT_ENOUGH_MEMORY │ 8 │ Sufficient memory is not available.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_SHARING_VIOLATION │ 32 │ A sharing violation occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NETWORK_ACCESS_DENIED │ 65 │ Network access is denied. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_NAME │ 123 │ There is an incorrect character or │
│ │ │ incorrectly formed file system name. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_FILENAME_EXCED_RANGE │ 206. │ The file name is longer than 8 charac-
│
│ │ │ ters or the extension is longer than 3 │
│ │ │ characters. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNotStarted │ 2102 │ The redirector NETWKSTA.200 has not
│
│ │ │ been started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_RemoteOnly │ 2106 │ This operation is not supported on │
│ │ │ workstations. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InternalError │ 2140 │ An internal error has occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadTransactConfig │ 2141 │ The server is not configured for
│
│ │ │ transactions. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidAPI │ 2142 │ The requested API is not supported on
│
│ │ │ the remote server. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidComputer │ 2351 │ The specified computer name is not
│
│ │ │ valid. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
Other codes could be returned from the following functions:
NetErrorLogClear fails if another process currently is using the error log file.
The NetErrorLogWrite function issues one admin alert when the error log file reaches 80% capacity and another when the file reaches 100% capacity. At 100% error log file capacity, NetErrorLogWrite fails. Therefore, applications periodically should clear the error log file of outdated information.
To set a maximum size for the error log file, use one of the following methods:
For information about writing an entry to the error log file, see Error Logging - NetErrorLogWrite.