Skip to content

[HttpClientFactory] ILoggerFactory dependency issue #89032

Description

@CodeBlanch

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

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions