if (!System.Diagnostics.EventLog.SourceExists("ApplicationName"))
System.Diagnostics.EventLog.CreateEventSource(
"ApplicationName", "Application");
System.Diagnostics.EventLog EventLog1 = new System.Diagnostics.EventLog();
EventLog1.Source = "ApplicationName";
EventLog1.WriteEntry("This is a simple event log entry");
The above code gives me the following error message:
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
I have added ASP.NET user to the ADMINISTRATORS group as well but it didn't help