[
https://issues.apache.org/jira/browse/LOG4J2-2036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16219010#comment-16219010
]
ASF GitHub Bot commented on LOG4J2-2036:
----------------------------------------
Github user cakofony commented on the issue:
https://github.com/apache/logging-log4j2/pull/115
@garydgregory The fix you provided also seems broken, after a couple
reloads I'm seeing:
```
java.lang.NullPointerException
--
at
org.apache.logging.log4j.core.config.composite.DefaultMergeStrategy.mergConfigurations(DefaultMergeStrategy.java:139)
at
org.apache.logging.log4j.core.config.composite.CompositeConfiguration.setup(CompositeConfiguration.java:122)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:235)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)
at
org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
at
org.apache.logging.log4j.core.LoggerContext.onChange(LoggerContext.java:667)
at
org.apache.logging.log4j.core.config.ConfiguratonFileWatcher$ReconfigurationRunnable.run(ConfiguratonFileWatcher.java:68)
at java.lang.Thread.run(Thread.java:748)
```
Also, if factory.getConfiguration returns null, currentConfig is left null
instead of currentConfig.
> CompositeConfiguration with monitorInterval fails to reload full configuration
> ------------------------------------------------------------------------------
>
> Key: LOG4J2-2036
> URL: https://issues.apache.org/jira/browse/LOG4J2-2036
> Project: Log4j 2
> Issue Type: Bug
> Components: Configurators
> Affects Versions: 2.9.0
> Environment: I have pushed a very simple repro here:
> https://github.com/cakofony/log4j2-composite-config-repro
> Reporter: Carter Douglas Kozak
>
> Steps to reproduce:
> 1. Create two configuration files, in my case I use a "default" embedded
> configuration on the classpath, and a second configuration on disk for
> overrides (this configuration uses monitorInterval=30).
> 2. Configurator.initialize(null, classLoader, ImmutableList.of(defaultUri,
> diskUri), null)
> 3. On initial startup, the two configurations are merged perfectly,
> everything works as expected.
> 4. Modify the on disk (override) configuration while the application is
> running, the failure is most apparent if I update a logger to reference an
> appender only defined in the "default" configuration. Reconfiguration
> executes but only using the file on disk, as though the first configuration
> has disappeared.
> This is a regression from 2.8.2, so I have rolled back to that version.
> Unfortunately 2.8.2 is affected by LOG4J2-1912 and complains with misleading
> warning messages so I've had to update the status logger to error level from
> info.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)