View Issue Details

IDProjectCategoryView StatusLast Update
0005738JEDI VCL00 JVCL Componentspublic2012-06-11 17:11
ReporteraltinkAssigned Toobones 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionsuspended 
Product Version3.39 
Target VersionFixed in Version 
Summary0005738: JvNTEventLog OnChange retrieves only every 5 sec
DescriptionI need to retrieve windows Event Logs at the moment they are added.
I place a JvNTEventLog and a memo in my form.
I set the JvNTEventLog properties (design time):
Log -> Security
Source -> Security

I activate JvNTEventLog in form creation:

procedure TForm1.FormCreate(Sender: TObject);
begin
  // Activate log
  JvNTEventLog1.Active := True;
end;

Then I wrote the code for the OnChange event to get notified in real time for the Security Event Logs

procedure TForm1.JvNTEventLog1Change(Sender: TObject);
begin
   JvNTEventLog1.Last;
   Memo1.Lines.Add(DateTimeToStr(JvNTEventLog1.EventRecord.DateTime));
end;

I see that a new line is added to the memo exactly every 5 seconds.

My Security Event Log is heavily used, it gets an entry almost every second or even quicker.
I am loosing Event Log records because the JvNTEventLog seems to react only once every 5 seconds.
Am I missing something in the way I use JvNTEventLog On Change ?

Can you help ?
best regards
Altin
Additional Informationmemo text goes like

12/12/2011 2:14:21 PM
12/12/2011 2:14:26 PM
12/12/2011 2:14:31 PM
12/12/2011 2:14:36 PM
12/12/2011 2:14:41 PM
12/12/2011 2:14:46 PM
12/12/2011 2:14:51 PM
12/12/2011 2:14:56 PM
12/12/2011 2:15:01 PM
12/12/2011 2:15:06 PM
12/12/2011 2:15:11 PM
12/12/2011 2:15:16 PM
TagsNo tags attached.

Activities

obones

2012-02-24 17:07

administrator   ~0019542

OnChange is triggered by the thread via a call to Synchronize. I'm convinced that the delay comes from here.
What could be done is call an unsynchronized event handler, this should solve the issue, provided you don't update the GUI at all from within this handler.

obones

2012-06-11 17:11

administrator   ~0019827

No answers, suspending the issue

Issue History

Date Modified Username Field Change
2011-12-12 15:20 altink New Issue
2012-02-22 14:58 obones Status new => acknowledged
2012-02-24 17:07 obones Note Added: 0019542
2012-02-24 17:07 obones Status acknowledged => feedback
2012-06-11 17:11 obones Note Added: 0019827
2012-06-11 17:11 obones Status feedback => resolved
2012-06-11 17:11 obones Resolution open => suspended
2012-06-11 17:11 obones Assigned To => obones