You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Remko Popma <re...@gmail.com> on 2014/06/15 14:33:23 UTC
LoggerContext config location
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?