title: Windows Event Log - how to register an event source?
body: <p>I am creating a new event source and logging a message using the code below:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          if (!EventLog.SourceExists("My Log"))
          {
              EventLog.CreateEventSource("My Application", "My Log");
              Console.WriteLine("Created new log \"My Log\"");
          }
  
          EventLog myLog = new EventLog("My Log");
          myLog.Source = "My Application";
          myLog.WriteEntry("Could not connect", EventLogEntryType.Error, 1001, 1);
      }
  </code></pre>
  
  <p>A custom event log with the name "My Log" is created (as expected) but the message is logged below the "Application" node. What am I doing wrong?</p>