How do I access Windows Event Viewer log data from Java

后端 未结 5 1509
不知归路
不知归路 2020-12-02 12:02

Is there any way to access the Windows Event Log from a java class. Has anyone written any APIs for this, and would there be any way to access the data from a remote machine

5条回答
  •  日久生厌
    2020-12-02 12:30

    there are a million (and one) options here ;)

    you could look at sigar

    http://cpansearch.perl.org/src/DOUGM/hyperic-sigar-1.6.3-src/docs/javadoc/org/hyperic/sigar/win32/EventLog.html

    mind the licensing though....

    or you could be quick and dirty and just periodically execute (and capture the output) D:>cscript.exe c:\WINDOWS\system32\eventquery.vbs /v

    then use event filtering params to refine the results etc... http://technet.microsoft.com/en-us/library/cc772995(WS.10).aspx

提交回复
热议问题