add EventLogRecord.getLogName method

This commit is contained in:
Doug MacEachern 2007-01-25 17:50:10 +00:00
parent 6eb5f9db0b
commit 8802b3929b
2 changed files with 17 additions and 1 deletions

View File

@ -97,7 +97,9 @@ public class EventLog extends Win32 {
public EventLogRecord read(int recordOffset) public EventLogRecord read(int recordOffset)
throws Win32Exception { throws Win32Exception {
return readlog(this.name, recordOffset); EventLogRecord record = readlog(this.name, recordOffset);
record.setLogName(this.name);
return record;
} }
private native EventLogRecord readlog(String name, int recordOffset) private native EventLogRecord readlog(String name, int recordOffset)

View File

@ -34,6 +34,20 @@ public class EventLogRecord {
String computerName; String computerName;
String user; String user;
String message; String message;
String logName;
EventLogRecord() {}
/**
* @return Event log name which generated the event
*/
public String getLogName() {
return this.logName;
}
void setLogName(String logName) {
this.logName = logName;
}
/* Get the record number for this event entry */ /* Get the record number for this event entry */
public long getRecordNumber() { public long getRecordNumber() {