Original post: #77312 (comment)
Description
I've run into (essentially) a circular reference issue because DefaultHttpClientFactory takes a depedency on ILoggerFactory via ctor injection.
OpenTelemetry has implemented an ILoggerProvider which may use HttpClient to export logs to different backends. We use IHttpClientFactory to allow users to control/customize the HttpClient instance. During construction of ILoggerFactory this provider is created which tries to access IHttpClientFactory which again tries to acces ILoggerFactory.
ILoggerFactory -> OpenTelemetryLoggerProvider -> LogExporter -> IHttpClientFactory -> ILoggerFactory
Ideally DefaultHttpClientFactory would not depend on ILoggerFactory so that it may be used in logging scenarios.
/cc @CarnaViire @noahfalk
Original post: #77312 (comment)
Description
I've run into (essentially) a circular reference issue because DefaultHttpClientFactory takes a depedency on ILoggerFactory via ctor injection.
OpenTelemetry has implemented an ILoggerProvider which may use HttpClient to export logs to different backends. We use IHttpClientFactory to allow users to control/customize the HttpClient instance. During construction of ILoggerFactory this provider is created which tries to access IHttpClientFactory which again tries to acces ILoggerFactory.
ILoggerFactory -> OpenTelemetryLoggerProvider -> LogExporter -> IHttpClientFactory -> ILoggerFactoryIdeally
DefaultHttpClientFactorywould not depend onILoggerFactoryso that it may be used in logging scenarios./cc @CarnaViire @noahfalk