apache / apache/logging-log4j2

LoggerContext fires 2 PropertyChangeEvent with 'propertyName' set to 'config' on a single reconfigure

Open
#3,546 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

The LoggerContext fires two PropertyChangeEvents of type LoggerContext.PROPERTY_CONFIG on a reconfigure.

A single reconfigure creates events in the following order:

The first one the oldValue == newValue because it is called during updateLogggers

```
java.beans.PropertyChangeEvent:
propertyName=config;
oldValue=com.tsystems.pwc.config.logging.log4j.api.config.DefinedCompositeConfiguration@7470563a
newValue=com.tsystems.pwc.config.logging.log4j.api.config.DefinedCompositeConfiguration@7470563a
```

The second one comes when the reconfiguration completes and is for the actual configuration change

```
java.beans.PropertyChangeEvent:
propertyName=config;
oldValue=com.tsystems.pwc.config.logging.log4j.api.config.DefinedCompositeConfiguration@3b99e345
newValue=com.tsystems.pwc.config.logging.log4j.api.config.DefinedCompositeConfiguration@7470563a

```

I am wondering if the `updateLoggers` PropertyChangeEvent should use a different property-name.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.