Search code examples
c#event-handlingevent-log

Monitoring event log


I have a question about how things are going on under the hood with this in C#. If I have some code like this:

// Create the event log monitor
eventLog.Log = eventLogToMonitor;
eventLog.EnableRaisingEvents = true;
eventLog.EntryWritten += new EntryWrittenEventHandler(EventLogMonitor);

Does .NET set up its own thread to monitor the event log for entries written, or how does it now that this event has happened?


Solution

  • It probably registers on the WMI events raised by the windows system itself.