win32utils-devel@rubyforge.org
2004-Oct-19 10:35 UTC
[Win32utils-devel] RE: Another Interesting "Problem" with Win32-EventLog
> -----Original Message----- > From: Joey Gibson [mailto:joey@joeygibson.com] > Sent: Tuesday, October 19, 2004 6:11 AM > To: ruby-talk@ruby-lang.org; Berger, Daniel > Subject: Re: Another Interesting "Problem" with Win32-EventLog > > > Daniel Berger wrote: > > >After getting home from work today I tried again on my home machine. > >My "System" log has over 1700 messages in it, but a test script with > >no failure. I intentionally wrote several hundred event log messages > >to my application log - about 2500 in total - and I still > couldn''t get > >it to fail. > > > > > > My Application log (the one that I''m trying to work with) has 2084 > records in it. > > >So, my gut feeling now is that it''s not the quantity of > messages, but > >something about one message in particular that''s causing it to crash. > > > > > > I ran my test and wrote down the record number of the last one that > showed up in the file. I will wait a little while until there > are some > more records (or I may add some myself...) and see if that > number comes > up again. > > Is there any way to just grab a particular record instead of > iterating > the entire collection?I *thought* you could do EventLog.read(source,server,EventLog::SEEK_READ,record_num), but it''s always coming back nil for me. Hm...another test to add.> I notice that the EventLog class doesn''t mixin > Enumerable; was this by design or is it a consequence of > having C code > underneath? Just wondering.I don''t that it makes sense to mixin Enumerable - where should "each" be defined?. However, I can tell you that in the next release the EventLog#read will return an array in non-block form. So, you can enumerate over the returned array, e.g. EventLog.read.each or EventLog.read[23] or whatever.> >Is there any chance you can narrow down a particular message it''s > >failing on? Is it always at the same point? Perhaps > something about > >the quantity or formatting of the event description is causing a > >problem. > > > > > I''ll let you know as soon as I have some more results.My suggestion would be to find the record number it''s failing on, and copy/paste the description (as well as any other information) via the Event Viewer GUI into an email. :) Regards, Dan