简体   繁体   中英

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

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?)

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, eg where they have it set to 0.
  • Use Levels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM