This is an automated email from the ASF dual-hosted git repository. pkarwasz pushed a commit to branch 2.x in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x by this push: new b00133be81 Correct log message format in `AbstractDriverManagerConnectionSource` (#3831) b00133be81 is described below commit b00133be816ad2d95cc1e8afe8eb66bba009591a Author: Junhyeok Lee <118912510+jhl221...@users.noreply.github.com> AuthorDate: Sun Jul 20 16:51:45 2025 +0900 Correct log message format in `AbstractDriverManagerConnectionSource` (#3831) * Correct log message format in AbstractDriverManagerConnectionSource The debug log message in AbstractDriverManagerConnectionSource had 4 placeholders but was supplied with 5 arguments. This corrects the format string to match the argument count, resolving the warning. Fixes #3828 * Add changelog entry --- .../db/jdbc/AbstractDriverManagerConnectionSource.java | 2 +- src/changelog/.2.x.x/3828_fix_log_placeholder_mismatch.xml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java index 6f46be6bdc..1facaa157a 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java @@ -160,7 +160,7 @@ public class AbstractDriverManagerConnectionSource extends AbstractConnectionSou connection = DriverManager.getConnection(actualConnectionString, toString(userName), toString(password)); } LOGGER.debug( - "{} acquired connection for '{}': {} ({}{@})", + "{} acquired connection for '{}': {} ({}@{})", getClass().getSimpleName(), actualConnectionString, connection, diff --git a/src/changelog/.2.x.x/3828_fix_log_placeholder_mismatch.xml b/src/changelog/.2.x.x/3828_fix_log_placeholder_mismatch.xml new file mode 100644 index 0000000000..884b93985d --- /dev/null +++ b/src/changelog/.2.x.x/3828_fix_log_placeholder_mismatch.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entry xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + https://logging.apache.org/xml/ns + https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" + type="fixed"> + <issue id="3828" link="https://github.com/apache/logging-log4j2/issues/3828"/> + <description format="asciidoc"> + Corrected an incorrect placeholder count in the AbstractDriverManagerConnectionSource debug log message to prevent unnecessary warnings. + </description> +</entry>