I'm replacing some existing code in my WCF service that logs directly to a custom event log with the Enterprise Library logging + exception handling blocks.
The old code, when running under the WindowsIdentity context of our application pool account (Admin on the web server), was able to log to our custom event log.
Now I've introduced Enterprise Library and I'm getting a security error:
"The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security."
The error is thrown on line 51 of FormattedTraceListenerWrapperBase:
this.innerListener.TraceData(eventCache, source, severity, id, base.Formatter.Format(data as LogEntry));
I've followed the code through the stack and I see where the impersonation is stripped away (we impersonate the caller), so I took out my code that did the same thing, but there's still a security exception.
Any thoughts on what the heck is going on?