Skip to content

Document the ILoggerFactory registration guarantee - #7982

Merged
andreasohlund merged 3 commits into
masterfrom
docs-logging-factory-guarantee
Oct 14, 2026
Merged

andreasohlund merged 3 commits into
masterfrom
docs-logging-factory-guarantee

Conversation

@andreasohlund

Copy link
Copy Markdown
Member

Adds docs/logging.md, a design page that documents a guarantee other repositories rely on: since 10.2, every endpoint's service collection contains a Microsoft.Extensions.Logging.ILoggerFactory. Transports and other components can link to this page instead of to the pull requests that introduced the behavior.

The page covers:

  • Where the registration happens (EndpointCreator.Configure, on the root service collection, through AddLogging with TryAdd semantics) and that Core resolves the factory with GetRequiredService.
  • Guidance for components, including the two cases where the guarantee does not apply: raw mode, and the deprecated LogManager.UseFactory path.

docs/README.md links the page under "Architecture and design".

The page is a design page and not an ADR because the public records (#7659, #7633, #7661, #7758) do not record the alternatives that were rejected. Internal context was consulted and is not quoted.

Verification: the statements were checked against the current code in EndpointCreator, EndpointPreparation, ReceiveComponent, LogManager, HostSettings, and KeyedServiceProviderAdapter.

@andreasohlund
andreasohlund marked this pull request as ready for review October 14, 2026 07:18
@danielmarbach
danielmarbach force-pushed the docs-logging-factory-guarantee branch from 0335249 to 7a706ca Compare October 14, 2026 10:36
@danielmarbach

Copy link
Copy Markdown
Contributor

With those additions, our internal guidelines can be deleted, I think.

@andreasohlund
andreasohlund enabled auto-merge (squash) October 14, 2026 10:42
@andreasohlund
andreasohlund merged commit e348459 into master Oct 14, 2026
4 checks passed
@andreasohlund
andreasohlund deleted the docs-logging-factory-guarantee branch October 14, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants