title: How to get EventLog to record user name into Window Event Log?
body: <p>I'm writing to the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx" rel="nofollow noreferrer">windows event log</a> using C#.  I can set every field visible in the mmc.exe "Computer Management" tool, except for the User field.</p>
  
  <p>The client application is ASP.NET and uses forms authentication.</p>
  
  <pre><code>public static void WriteOnce()
  {
      EventLog log = new EventLog("MyApp");
      if (!EventLog.SourceExists("MySource"))
      {
          EventSourceCreationData data = new EventSourceCreationData("MySource", "MyApp");
          EventLog.CreateEventSource(data);
      }
      log.Source = "MySource";
      log.WriteEntry("Hello World", EventLogEntryType.Information,123,456,new byte[]{1,2,3});
  }
  </code></pre>
  
  <p>UPDATE: I checked, in ASP.NET even if set identity impersonation=true &amp; authentication=windows and still no user. </p>
  
  <p>I also checked, in a console app, no user.</p>