ASP.在IIS 7下运行的NET3.5似乎不允许这种开箱即用.
if (!EventLog.SourceExists("MyAppLog"))
EventLog.CreateEventSource("MyAppLog", "Application");
EventLog myLog = new EventLog();
myLog.Source = "MyAppLog";
myLog.WriteEntry("Message");