I would like the ability to get the ConfigurationSource from the
LoggerContext in order to fix  LOG4J2-539
<https://issues.apache.org/jira/browse/LOG4J2-539>.

Currently LoggerContext has a field configLocation:URI, but this field may
(or may not) be initialized when the LoggerContext is constructed, and is
not updated when it is reconfigured. In fact, all reconfiguring uses inner
class ConfigurationFactory.ConfigurationSource.

I would like to make the following changes:
* make ConfigurationFactory.ConfigurationSource a top-level class
* add method getConfigurationSource to the Configuration interface
* remove field configLocation (and getter/setter) from LoggerContext

Client code that needs LoggerContext.getConfigLocation() can instead call
LoggerContext.getConfiguration().getConfigurationSource().
This is more reliable than getConfigLocation() as this URI is often null
and may not be in sync with the LoggerContext's Configuration after a
reconfigure.

Thoughts?

Reply via email to