title: Using WMI to monitor event log
body: <p>I am trying to use WMI to monitor the event log for EntryWritten events, so I set up the handler as follows:</p>
  
  <pre><code>// Create the event log monitor
          string query = "Select * From __InstanceCreationEvent Where TargetInstance.LogFile='Application'";
          WqlEventQuery aProcessCreationQuery = new WqlEventQuery(query);
          ManagementEventWatcher aWatcher = new ManagementEventWatcher(aProcessCreationQuery);
          aWatcher.EventArrived += new EventArrivedEventHandler(EventLogMonitor);
  </code></pre>
  
  <p>But my handler method EventLogMonitor never fires, even when things are being written to the Application Event log. My application runs as a service monitoring for things written to the event log. </p>
  
  <p>I found somewhere that I may need to add the line:</p>
  
  <pre><code>aWatcher.Start()
  </code></pre>
  
  <p>in the StartService() method, but if I do the service wont start. I wonder if anybody has any ideas on this?</p>