Microsoft.Diagnostics.Tracing.EventSource not respecting EventListener enabled keywords for None

452 views Asked by At

I have an event source which derives from EventSource, and an event listener which derives from EventListener.

I call the event listener EnableEvents passing in the EventKeywords parameter, but the listener also gets called for any events with no Keywords.

Is this expected behaviour, and what workaround is there (apart from inventing dummy keywords for all my events?)

1

There are 1 answers

1
Sergey Baranchenkov On BEST ANSWER

Yes, that is expected behavior, that is partially covered here.

You can:

  • Specify keywords for all events.
  • Update your EventListener derived class to handle events w/o keywords, e.g. where they have it set to 0.
  • Use Levels.