I want to write a program that reads the events in the windows event log. I have found some code that works and it seems great, apart from one thing, I can't get the subject details. What I mean is the descriptive line that appears at the top of the event. For example this event says " Initialization status for service objects." I want to be able to capture that and pass it on. If I look in the vwread variable in my code I can see the other details and print them out but I cannot get that bit. Anybody know where it might be. I've attached a doc showing the Event and the output from my code. It looks like it ought to be strings but such a thing doesn't seem to exist!
I got the code I'm using from here: http://code.dblock.org/2010/09/30/jna-reading-windows-event-log-entries-in-java.html It works fine in as much as it gives me the eventid, time, machine etc but it doesn't give me the event summary. I had a look through as many examples as I could find similar to this and none of them show it, maybe it's not in there? I'm not sure how to use the c++ interface from within Java and cannot see the summary mentioned in there either. This is the code I am using which works as far as it goes.
I gave up. After looking at Jacob, jWmi, jawin and jinterop I sat back and thought about it. Best way to get information out of windows files is to use windows. A powershell script put together in about 20 minutes gets log file entries and stores them in a file in a readable format. It's a shame I can't do it all from Java and there has to be a file drop in the middle but I have to move on and I was getting nowhere with this, I don't think the summary information is in the EventLogRecord.
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad: