2008-09-16 2 views
2

JNI를 사용하지 않고 Windows EventLog를 읽는 방법에 대한 지침이있는 사람이 있습니까? 또는 을 사용해야하는 경우 JNI를 사용하면 좋은 오픈 소스 라이브러리가 있습니까?Java로 Windows EventLog를 읽는 방법

답변

0

JNI을 사용하는 당신은해야합니다.

2

JNA 3.2.8에는 모든 이벤트 로깅 기능과 Java 반복기가 모두 구현되어 있습니다. this을 읽으십시오.

EventLogIterator iter = new EventLogIterator("Application");   
while(iter.hasNext()) { 
    EventLogRecord record = iter.next(); 
    System.out.println(record.getRecordId() 
      + ": Event ID: " + record.getEventId() 
      + ", Event Type: " + record.getType() 
      + ", Event Source: " + record.getSource()); 
} 
관련 문제