Share via


how to read windows event using Java

Question

Tuesday, January 8, 2019 11:11 AM

I want to read windows events for all journals using java class via JNI. It is possible using java and c/c++, if yes how? where can I find the guide link and is there any predefined API that Microsoft has exposed and we can consume those API directly?

All replies (1)

Thursday, January 10, 2019 3:06 AM

Hello,

>>I want to read windows events for all journals using java class via JNI. It is possible using java and c/c++, if yes how? where can I find the guide link and is there any predefined API that Microsoft has exposed and we can consume those API directly?

Do you mean that you want to read the Windows Event Logs? If so, maybe you should learn more about the Window Event APIs. Here is a link.
/en-us/windows/desktop/WES/windows-event-log

You could refer to this link to learn more about how to call Windows API method from Java.
https://stackoverflow.com/questions/2389156/calling-win32-api-method-from-java

And seems that using JNA should be easier than JNI. More links here.
https://stackoverflow.com/questions/606820/is-there-a-java-library-to-access-the-native-windows-api
https://stackoverflow.com/questions/14346761/accessing-windows-api-from-a-java-application-jni-or-jna

Best Wishes,

Jack

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].