-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
In PR dotnet/corefx#16393 we have changed logging (DiagnosticSource) in HttoClient and introduced a new events:
- System.Net.Http.HttpRequestOut.Start
- System.Net.Http.HttpRequestOut.Stop
- System.Net.Http.Exception
We kept events that have been previously fired, but deprecated them:
- System.Net.Http.Request
- System.Net.Http.Response
We also made new and old events mutually exclusive.
However there is a valid production scenario when there are two listeners in the application that want different set of events:
e.g. ApplicationInsights for the 'new' events and Glimpse for the 'old' events. With mutual exclusiveness, only 'new' listener will receive any events.
Besides Glimpse, VisualStudio consumes 'old' events, however I do not know whether it is internal logging or listener is somehow injected into the application where other listeners may exist; may be @nbilling can provide more details on it.
Potentially there are other consumers affected by this change.
Simple solution would be to check for deprecated event listener with IsEnabled method even if there was a listener to new event, however the assumption is that frequently there will be just one listener.
IsEnabled for deprecated events may be cached under the assumption that there are no consumers that dynamically subscribe and unsubscribe.