-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
CompositeConfiguration merges into the root node of the first configuration instead of using its own root-node #3458
Comments
@ppkarwasz / @rgoers - I am ready to create a PR for this, but I noticed something else - if you agree I will adjust the description and include the change in the PR. In the current
This will not work for custom Configurations that cannot be instantiated from the I was wondering if taking advantage of the
One more thing - the original and my suggestion above both drop the original configuration from the new Configuration if the reconfigure fails - this results in the configurattion (and its configuration source) being lost. For example if at runtime an XML configuration file is unavailable or locked for some reason, it will fail the reconfigure and be removed from the composite - a future reconfigure will not attempt to recover. Should the original configuration be kept as-is in this case? IMHO it would generally be better if the 'Reconfigurable' interface never expected null to be returned - for example the XmlConfigurattion returns an empty configuration that keeps its ConfigurationSource instead of null - then it can be added to the composite and attempted again in the next reconfigure. Please give me a short feedback so I can finish up and submit a PR. :) Thanks! @rgoers (I included you because I think the original code is from you?) |
Log4j 2.24..3
The composite configuration uses the root-node of the first configuration in the provided list as the basis for the merge of all configurations.
As @ppkarwasz mentioned in the comments of (#3173) this is an error because it changes the original source configuration instead of populating the composite.
The fix would be to use the composite configuration's rootNode (protected access via 'AbstractConfiguration'). The rootNode is created empty by the super-constructor.
The text was updated successfully, but these errors were encountered: