Skip to content

Commit b00133b

Browse files
authored
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
1 parent 8ec5703 commit b00133b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractDriverManagerConnectionSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public Connection getConnection() throws SQLException {
160160
connection = DriverManager.getConnection(actualConnectionString, toString(userName), toString(password));
161161
}
162162
LOGGER.debug(
163-
"{} acquired connection for '{}': {} ({}{@})",
163+
"{} acquired connection for '{}': {} ({}@{})",
164164
getClass().getSimpleName(),
165165
actualConnectionString,
166166
connection,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns="https://logging.apache.org/xml/ns"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="
5+
https://logging.apache.org/xml/ns
6+
https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
7+
type="fixed">
8+
<issue id="3828" link="https://github.com/apache/logging-log4j2/issues/3828"/>
9+
<description format="asciidoc">
10+
Corrected an incorrect placeholder count in the AbstractDriverManagerConnectionSource debug log message to prevent unnecessary warnings.
11+
</description>
12+
</entry>

0 commit comments

Comments
 (0)