Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JWT007 opened this issue Mar 17, 2025 · 1 comment
Labels
enhancement Additions or updates to features

Comments

@JWT007
Copy link
Contributor

JWT007 commented Mar 17, 2025

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.

@vy vy added the enhancement Additions or updates to features label Apr 13, 2025
@vy
Copy link
Member

vy commented Apr 13, 2025

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

@JWT007, can you elaborate on this suggestion, please?

Would you also mind sharing the (backward) compatibility risks of such a change?

@ppkarwasz ppkarwasz moved this from To triage to Waiting for user in Log4j bug tracker Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additions or updates to features
Projects
Status: Waiting for user
Development

No branches or pull requests

2 participants