Re: Problem with Event Log event triggers
- From: "Dale Preston" <dalepres@xxxxxxxxxxxxx>
- Date: Tue, 12 Apr 2005 18:31:29 -0500
According to the Microsoft documentation on the EntryWritten event, that is
by design - a feature...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticseventlogclassentrywrittentopic.asp
HTH
Dale Preston
MCAD, MCDBA, MCSE
"amol" <amol_k3@xxxxxxxxx> wrote in message
news:1113339103.194640.121830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have the following code to raise events when something gets written
> to the Application log. The problem I'm seeing is when a bunch of
> entries get written to the log at the same time (or within a couple of
> seconds of each other). I receive an event for the first entry, but
> the events for the other entries aren't triggered until another entry
> is written to the log.
>
> System.Diagnostics.EventLog eventLogToMonitor = new
> System.Diagnostics.EventLog();
>
> eventLogsToMonitor.Log = "Application";
> eventLogsToMonitor.EnableRaisingEvents = true;
> eventLogsToMonitor.EntryWritten += new
> System.Diagnostics.EntryWrittenEventHandler(this.entryWrittenToLog);
>
> .....
>
> private void entryWrittenToLog(object sender,
> System.Diagnostics.EntryWrittenEventArgs e)
> {
> Console.WriteLine(DateTime.Now + ": " + e.Entry.Source);
> }
>
>
> For example,
>
> 2:00:00 pm - Error 1 written to log
> 2:00:00 pm - Error 2 written to log
> 2:00:01 pm - Error 3 written to log
> 2:05:00 pm - Information 1 written to log
>
> I see on the console:
>
> 2:00:00: Error 1 source
> 2:05:00: Error 2 source
> 2:05:00: Error 3 source
> 2:05:00: Information 1 source
>
> Basically, an event is raised in my code when Error 1 gets written. NO
> events are raised for Error 2 or 3. Then 5 minutes later when
> Information 1 gets written, I see events being raised for Error 2, 3
> and Information 1 all together.
>
> Any ideas on what the problem might be?
>
> Thanks,
> Amol
>
.
- Follow-Ups:
- Re: Problem with Event Log event triggers
- From: amol
- Re: Problem with Event Log event triggers
- References:
- Problem with Event Log event triggers
- From: amol
- Problem with Event Log event triggers
- Prev by Date: Passing null value to Crystal Reports parameter
- Next by Date: Re: How to print right aligned graphics.drawstring?
- Previous by thread: Problem with Event Log event triggers
- Next by thread: Re: Problem with Event Log event triggers
- Index(es):
Relevant Pages
|
Loading