Skip to content
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

Bump spring-framework.version from 5.3.31 to 5.3.32 #2293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.logging.log4j.core.config;

import static org.assertj.core.api.Assertions.assertThat;

import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
import org.junit.jupiter.api.Test;

public class ConfigurationPropertiesOrderTest {

@Test
void propertiesCanComeLast() {
final Configuration config = new AbstractConfiguration(null, ConfigurationSource.NULL_SOURCE) {
@Override
public void setup() {
// Nodes
final Node appenders = newNode(rootNode, "Appenders");
rootNode.getChildren().add(appenders);

final Node console = newNode(appenders, "Console");
console.getAttributes().put("name", "${console.name}");
appenders.getChildren().add(console);

final Node loggers = newNode(rootNode, "Loggers");
rootNode.getChildren().add(loggers);

final Node rootLogger = newNode(loggers, "Root");
rootLogger.getAttributes().put("level", "INFO");
loggers.getChildren().add(rootLogger);

final Node properties = newNode(rootNode, "Properties");
rootNode.getChildren().add(properties);

final Node property = newNode(properties, "Property");
property.getAttributes().put("name", "console.name");
property.getAttributes().put("value", "CONSOLE");
properties.getChildren().add(property);
}

private Node newNode(final Node parent, final String name) {
return new Node(rootNode, name, pluginManager.getPluginType(name));
}
};
config.initialize();

final Appender noInterpolation = config.getAppender("${console.name}");
assertThat(noInterpolation).as("No interpolation for '${console.name}'").isNull();
final Appender console = config.getAppender("CONSOLE");
assertThat(console).isInstanceOf(ConsoleAppender.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -647,18 +647,21 @@ protected void doConfigure() {
processConditionals(rootNode);
preConfigure(rootNode);
configurationScheduler.start();
if (rootNode.hasChildren() && rootNode.getChildren().get(0).getName().equalsIgnoreCase("Properties")) {
final Node first = rootNode.getChildren().get(0);
createConfiguration(first, null);
if (first.getObject() != null) {
final StrLookup lookup = (StrLookup) first.getObject();
if (lookup instanceof LoggerContextAware) {
((LoggerContextAware) lookup).setLoggerContext(loggerContext.get());
// Find the "Properties" node first
boolean hasProperties = false;
for (final Node node : rootNode.getChildren()) {
if ("Properties".equalsIgnoreCase(node.getName())) {
hasProperties = true;
createConfiguration(node, null);
if (node.getObject() != null) {
final StrLookup lookup = node.getObject();
runtimeStrSubstitutor.setVariableResolver(lookup);
configurationStrSubstitutor.setVariableResolver(lookup);
}
runtimeStrSubstitutor.setVariableResolver(lookup);
configurationStrSubstitutor.setVariableResolver(lookup);
break;
}
} else {
}
if (!hasProperties) {
final Map<String, String> map = this.getComponent(CONTEXT_PROPERTIES);
final StrLookup lookup = map == null ? null : new PropertiesLookup(map);
final Interpolator interpolator = new Interpolator(lookup, pluginPackages);
Expand All @@ -670,17 +673,15 @@ protected void doConfigure() {
boolean setLoggers = false;
boolean setRoot = false;
for (final Node child : rootNode.getChildren()) {
if (child.getName().equalsIgnoreCase("Properties")) {
if (tempLookup == runtimeStrSubstitutor.getVariableResolver()) {
LOGGER.error("Properties declaration must be the first element in the configuration");
}
if ("Properties".equalsIgnoreCase(child.getName())) {
// We already used this node
continue;
}
createConfiguration(child, null);
if (child.getObject() == null) {
continue;
}
if (child.getName().equalsIgnoreCase("Scripts")) {
if ("Scripts".equalsIgnoreCase(child.getName())) {
for (final AbstractScript script : child.getObject(AbstractScript[].class)) {
if (script instanceof ScriptRef) {
LOGGER.error(
Expand All @@ -690,19 +691,19 @@ protected void doConfigure() {
scriptManager.addScript(script);
}
}
} else if (child.getName().equalsIgnoreCase("Appenders")) {
} else if ("Appenders".equalsIgnoreCase(child.getName())) {
appenders = child.getObject();
} else if (child.isInstanceOf(Filter.class)) {
addFilter(child.getObject(Filter.class));
} else if (child.getName().equalsIgnoreCase("Loggers")) {
} else if (child.isInstanceOf(Loggers.class)) {
final Loggers l = child.getObject();
loggerConfigs = l.getMap();
setLoggers = true;
if (l.getRoot() != null) {
root = l.getRoot();
setRoot = true;
}
} else if (child.getName().equalsIgnoreCase("CustomLevels")) {
} else if (child.isInstanceOf(CustomLevels.class)) {
customLevels = child.getObject(CustomLevels.class).getCustomLevels();
} else if (child.isInstanceOf(CustomLevelConfig.class)) {
final List<CustomLevelConfig> copy = new ArrayList<>(customLevels);
Expand Down
4 changes: 2 additions & 2 deletions log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<bsh.version>2.0b6</bsh.version>
<cassandra.version>3.11.16</cassandra.version>
<cassandra-driver.version>3.11.5</cassandra-driver.version>
<commons-codec.version>1.16.0</commons-codec.version>
<commons-codec.version>1.16.1</commons-codec.version>
<commons-compress.version>1.25.0</commons-compress.version>
<commons-csv.version>1.10.0</commons-csv.version>
<commons-dbcp2.version>2.11.0</commons-dbcp2.version>
Expand Down Expand Up @@ -139,7 +139,7 @@
<plexus-utils.version>3.5.1</plexus-utils.version>
<slf4j.version>2.0.9</slf4j.version>
<spring-boot.version>2.7.18</spring-boot.version>
<spring-framework.version>5.3.31</spring-framework.version>
<spring-framework.version>5.3.32</spring-framework.version>
<system-stubs.version>2.0.3</system-stubs.version>
<tomcat-juli.version>10.0.27</tomcat-juli.version>
<velocity.version>1.7</velocity.version>
Expand Down
9 changes: 9 additions & 0 deletions src/changelog/.2.x.x/allow_arbitrary_properties_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/changelog"
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.3.xsd"
type="fixed">
<description format="asciidoc">
Allow the &lt;Properties&gt; node to appear in any position in the configuration element.
</description>
</entry>
8 changes: 8 additions & 0 deletions src/changelog/.2.x.x/update_commons_codec_commons_codec.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/changelog"
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.3.xsd"
type="updated">
<issue id="2277" link="https:/apache/logging-log4j2/pull/2277"/>
<description format="asciidoc">Update `commons-codec:commons-codec` to version `1.16.1`</description>
</entry>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/changelog"
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.3.xsd"
type="updated">
<issue id="2293" link="https:/apache/logging-log4j2/pull/2293"/>
<description format="asciidoc">Update `org.springframework:spring-framework-bom` to version `5.3.32`</description>
</entry>
4 changes: 4 additions & 0 deletions src/site/_release-notes/_2.x.x.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ This releases contains ...

* Fix regression in `JdkMapAdapterStringMap` performance. (https:/apache/logging-log4j2/issues/2238[2238])
* Fix the behavior of `Logger#setLevel` and `Logger#getLevel` in the Log4j 1.2 bridge. (https:/apache/logging-log4j2/issues/2282[2282])
* Fix the behavior of `CoreLogger#setLevel` in the log4j-jul module. (https:/apache/logging-log4j2/issues/2282[2282])
* Allow deserialization of all arrays of allowed classes. (https://issues.apache.org/jira/browse/LOG4J2-3680[LOG4J2-3680])
* Allow the <Properties> node to appear in any position in the configuration element.
* Fix forgotten `threadName` field in `RingBufferLogEvent#clear()` (https:/apache/logging-log4j2/issues/2234[2234])
* Fix `StringBuilder` cache corruption on recursive access
* Fixed use of `SecurityManager` in `LoaderUtil` where `AccessController::doPrivileged` should only be invoked when a `SecurityManager` is installed. Some runtimes do not seem to have this method available. (https:/apache/logging-log4j2/issues/2129[2129])
Expand All @@ -55,8 +57,10 @@ This releases contains ...
=== Updated

* Update `com.fasterxml.jackson:jackson-bom` to version `2.16.1` (https:/apache/logging-log4j2/pull/2126[2126])
* Update `commons-codec:commons-codec` to version `1.16.1` (https:/apache/logging-log4j2/pull/2277[2277])
* Update `io.netty:netty-bom` to version `4.1.107.Final` (https:/apache/logging-log4j2/pull/2284[2284])
* Update `org.apache.logging:logging-parent` to version `10.6.0` (https:/apache/logging-log4j2/pull/2197[2197])
* Update `org.eclipse.jetty:jetty-bom` to version `9.4.54.v20240208` (https:/apache/logging-log4j2/pull/2287[2287])
* Update `org.jctools:jctools-core` to version `4.0.3` (https:/apache/logging-log4j2/pull/2270[2270])
* Update `org.springframework:spring-framework-bom` to version `5.3.32` (https:/apache/logging-log4j2/pull/2293[2293])
* Update `org.zeromq:jeromq` to version `0.6.0` (https:/apache/logging-log4j2/pull/2271[2271])