So I'm using SLAB and I have a Database listener logging out to a database. I'm testing with a single method on the event source. The issue that I'm having is that the log is being inserted into the database just as I want it, but I'm also getting an exception log before every entry
In my output window, it says exactly the same thing, "EventSourceException". I'm having a hard time figuring out what the exception is let alone how to fix it.
Here is the event source method:
[Event(2, Message = "ACCESS_ADMIN",
Level = EventLevel.LogAlways,
Keywords = Keywords.AdminAccess)]
public void LogAdminAccess(string userInfo, string resource, string clientIpAddress, bool succeeded)
{
SetCurrentThreadActivityId(GetNewActivityId());
WriteEventWithRelatedActivityId(2, GetRequestId(), userInfo, resource, clientIpAddress, succeeded);
}
This is how the listener is being initialized, inproc:
var dbSemanticLogListener = SqlDatabaseLog.CreateListener(
"MyComponent",
PayliteRegistry.MainDatabaseConnectionString);
dbSemanticLogListener.EnableEvents(
AprivaPciAuditEventSource.Log,
EventLevel.LogAlways,
MyEnum.Keywords.AccountModified |
MyEnum.Keywords.AdminAccess |
MyEnum.Keywords.DatabaseAccess |
MyEnum.Keywords.ApplicationStateChange);
And the call to the logger:
MyLoggerClass.Log.LogAdminAccess(
userInfo,
request.RequestUri.AbsolutePath,
request.GetClientIpAddress(),
true);
Any ideas on what the problem could be or at least how to get to the actual exception being thrown?
Other bits not shown
- This EventSource class is sealed
- I've stepped through and verified that the methods
GetNewActivityId()
andGetRequestId()
are not throwing the exception - The exception shows up in the output window when
WriteEventWithRelatedActivityId(...
is executed but the exception isn't bubbling up; it appears to be handled in the base class.