Skip to content

Simplify startup logging paths and retire DefaultFactory runtime logger internals #7665

Merged
danielmarbach merged 12 commits into
masterfrom
slot-simplification
Mar 26, 2026
Merged

Simplify startup logging paths and retire DefaultFactory runtime logger internals #7665
danielmarbach merged 12 commits into
masterfrom
slot-simplification

Conversation

@danielmarbach
Copy link
Copy Markdown
Contributor

@danielmarbach danielmarbach commented Mar 20, 2026

  • Simplifies startup log routing by removing per-slot deferred state machinery (SlotFactoryState, per-logger deferred queues) in favor of slot-scoped startup buffering and deterministic draining on slot registration.
  • Fixes a startup race where logs could fall back to the default logger during concurrent slot factory registration.
  • Preserves startup visibility by flushing unresolved scoped startup logs to Trace when a slot is unregistered before its factory is available.
  • Hollows out deprecated DefaultFactory runtime behavior and removes core DefaultLoggerFactory / DefaultLog path.
  • Keeps legacy configuration bridge behavior for directory/log level via GetLoggingConfiguration().
  • Slot-scoped startup logs stay slot-scoped and are drained when that slot factory registers.
  • If a slot never gets a factory, pending scoped startup logs are emitted to Trace on unregister (single flush, no duplicates).
  • Direct logger retrieval from DefaultFactory.GetLoggingFactory().GetLogger(...) is now explicitly unsupported and throws a meaningful exception.

Tradeoffs

  • The Trace fallback only applies to a narrow edge case: logs written inside a slot scope before that slot ever gets a registered MEL-backed factory, followed by slot unregistration.
  • In the normal path, endpoint startup wires MEL through DI and RegisterSlotFactory, so scoped startup logs are drained to the proper slot logger and never hit Trace.
  • In other words, this is a last-resort safety net for abnormal startup/lifecycle failures, not a primary logging path.
  • In the MEL/DI model, logger infrastructure is expected to exist once the host is built; pre-host or failed-host windows are inherently transitional, so a degraded fallback (Trace) is acceptable.
  • This preserves signal (no silent loss of scoped startup logs) without reintroducing the removed legacy default logger pipeline.

@danielmarbach danielmarbach changed the title Slot simplification Simplify startup logging paths and retire DefaultFactory runtime logger internals Mar 20, 2026
@danielmarbach danielmarbach marked this pull request as ready for review March 20, 2026 16:51
@danielmarbach danielmarbach merged commit 8d26370 into master Mar 26, 2026
4 checks passed
@danielmarbach danielmarbach deleted the slot-simplification branch March 26, 2026 05:25
@danielmarbach danielmarbach added this to the 10.2.0 milestone Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants