You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the problem here is that LoupeLoggerProvider can be hooked up from the WebHostBuilder to start logging before the Startup class has even been created, which means the callback-configured options are not there.
The obvious fix is to add an Action<AgentConfiguration> callback parameter to ILoggingBuilder.AddLoupe so that programmatic configuration can be done there too.
BUT.
Having provided that callback at the logging.AddLoupe point, developer Alice might reasonably assume that she has now configured Loupe and shouldn't have to do it again.
However, developer Bob might want a different callback for metrics vs logging.
So my thinking is, add the callback to logging.AddLoupe, keep hold of it internally (in a static field somewhere) and use it again in services.AddLoupe if no callback is provided there.
Using
ServicesExtensions.AddLoupe(...,...)
with the callback let users to customize the configuration.On the other side,
LoupeLoggerProvider
depends on IConfiguration and binds the again, hence all changes made in the callback are 'lost'.Should
LoupeLoggerProvider
depend on of theIOptions<AgentConfiguration>
instead?The text was updated successfully, but these errors were encountered: