public class EventLog extends Handle
INFINITE_TIMEOUT, INVALID_HANDLE_VALUE, STATUS_ABANDONED_WAIT_0, STATUS_TIMEOUT, STATUS_WAIT_0
Constructor and Description |
---|
EventLog(java.lang.String logName)
Opens an event log for reading.
|
EventLog(java.lang.String serverName,
java.lang.String logName)
Opens a remote event log for reading.
|
Modifier and Type | Method and Description |
---|---|
void |
backup(java.io.File file)
Backs up the opened event log to a file.
|
void |
clear()
Clears the opened event log.
|
void |
close()
Closes the event log handle.
|
java.lang.String |
getLogName()
Returns the name of the opened log.
|
java.util.List |
getMessages()
Returns the list of event log messages.
|
int |
getRecordsCount()
Returns the number of records in the event log.
|
java.lang.String |
getServerName()
If a remote event log has been opened, then the function returns the name of the remote server.
|
static EventLog |
openBackup(java.io.File backup)
Opens the event log that was backed up.
|
static void |
reportEvent(EventLogMessage message)
Posts the message to an event log.
|
clone, closeHandle, equals, waitFor, waitFor
asFunction, asFunction, asTypedPointer, castTo, castTo, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, write
public EventLog(java.lang.String logName)
logName
- specifies the name of the log to be opened.public EventLog(java.lang.String serverName, java.lang.String logName)
serverName
- is the UNC name of the server.logName
- specifies the name of the log to be opened.public java.lang.String getLogName()
public java.lang.String getServerName()
null
.public static EventLog openBackup(java.io.File backup)
backup
- specifies the backup file.public void backup(java.io.File file)
file
- specifies the backup file.public void close()
public void clear()
public int getRecordsCount()
public java.util.List getMessages()
EventLogMessage
.EventLogMessage
public static void reportEvent(EventLogMessage message)
message
- specifies the message to be posted.