Closed codethug closed 10 years ago
There seems to be an issue with keywords. ESP automatically implements keywords for your events, but it seems that the listener is filtering it out.
For now, try this:
listener.EnableEvents(SmsEventSource3.Log, EventLevel.Verbose, (EventKeywords)(-1));
And I'll put in a fix for it.
sigh
When you call EventListener.EnableEvents with no keywords, it only enables events with Keyword=None. When you call EventListener.EnableEvents WITH keywords (even -1), it only enables events WITH keywords.
That makes no sense to me. I'm sure there's a reason.
I'd like ESP to work exactly like a native implementation, so I'm going to turn off AutoKeywords by default. You'll be able to turn it on with the EventSourceImplementation attribute, or by a global flag (so people don't have to change too much existing code).
I'll also have to bump the version to 3.0 to signal to people that it's a breaking change.
Ok, I put v3.0 in nuget.
I'm actually glad that I made this change. I knew something wasn't quite right with keywords, but now it all lines up with the default implementation, so future issues won't be my problem. :)
Thanks, Jon! And thanks for updating NuGet.
I'm using EventSourceProxy, and it's emitting events, which I can view in PerfView. However, I'm having trouble getting it to work with the Semantic Logging Application Block. Let's look at two EventSources I created:
SmsEventSource2 is a standard EventSource that calls WriteEvent directly. SmsEventSource3 uses EventSourceProxy. I have code that calls these logging methods, and they both make events appear when I monitor with Perfview.
That's working great.
The problem comes when I try to use SLAB to log to SQLServer. Here is how I have it set up:
The events from SmsEventSource2 are making it to the SQL Server, but not the ones from SmsEventSource3. Any thoughts on what I'm doing wrong?
My only guess is that I'm calling EnableEvents and passing in something that shows up as the type of my abstract class (SmsEventSource2) instead of the actual class (SmsEventSource2_Implemented), but I'm not really sure how else to do this.