I have written:
.
.
.
//Log exception to the event log
if (!EventLog.SourceExists("PodaHIS")) {
EventLog.CreateEventSource("PodaHIS", "Application");
}
EventLog eventLog = new EventLog();
eventLog.Log = "Application";
eventLog.Source = "PodaHIS";
eventLog.WriteEntry(error.ToString(), EventLogEntryType.Error);
I have also enabled read permission to LOCALMACHINE\ASPNET.
And in return i get:
The source was not found, but some or all event logs could not be searched. Inaccesible logs: Security.
Does anyone know why this is happening?