Hi Matt, On Sun, 18 Dec 2022 at 20:30, Matt Sicker <m...@musigma.org> wrote: > During this bootstrapping, if the configuration location is available (such > as for a unit test), should LoggerContext set up the configuration provided? > Or is there some sort of cyclic dependency here preventing us from loading > ConfigurationFactory right away? So far, the only cyclic dependencies I’ve > found are related to plugins created in the DefaultConfiguration (or the > NullConfiguration in some cases), but those are already commented as such > (like in PatternLayout).
I think we should rely more on our `LifeCycle` abstraction: `Configuration` starts in the "initializing" state and does not have any subcomponents (especially those that require a `LoggerContext` to be present) until `initialize()` is called. We can do the same thing with `LoggerContext`: after the constructor exits it does not have a configuration and is in the "initializing" state. The configuration will be created on an `initialize()` call (maybe chained from `start()`). By then we can safely pass a reference to `LoggerContext` to the `AbstractConfiguration` constructor. Logging does not occur until `start()` is called. Piotr