title: How to write to a custom event log?
body: <p>I'm trying to get my .Net Windows Service to right to a custom event log.  I'm using <code>EventLogInstaller</code> to create the event log and source when the application is installed.  I read <a href="http://msdn.microsoft.com/en-us/library/xzwc042w.aspx" rel="nofollow noreferrer">here</a> that it takes a while for Windows to register the source so they reccomend you restart the application before trying to write to the log.</p>
  
  <p>As this is a Windows Service I didn't want to have to force a computer restart or get the user to manually start the service up, so I use this code to wait for the log to exist and then start the service automatically.</p>
  
  <pre><code>while (!(EventLog.Exists("ManageIT") || EventLog.SourceExists("ManageIT Client Service")))
  {
      Thread.Sleep(1000);
  }
  
  System.ServiceProcess.ServiceController controller = new System.ServiceProcess.ServiceController("ManageIT.Client.Service");
  controller.Start();
  </code></pre>
  
  <p>My problem is that events from the service are still written to the Application Log and although I can see my custom log in the Registry Editor it does not show up in the Windows 7 Event Viewer.</p>
  
  <p>Any help will be much appreciated.</p>