-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing code
Description
Discussed in #3827
Originally posted by RichMacDonald July 15, 2025
Version 2.24.3 org.apache.logging.log4j.core.appender.db.jdbc.AbstractDriverManagerConnectionSource line 162 has a method
LOGGER.debug(
"{} acquired connection for '{}': {} ({}{@})",
getClass().getSimpleName(),
actualConnectionString,
connection,
connection.getClass().getName(),
Integer.toHexString(connection.hashCode()));
That eventually causes org.apache.logging.log4j.message.ParameterFormatter line 252 to trigger:
STATUS_LOGGER.warn(
"found {} argument placeholders, but provided {} for pattern `{}`",
analysis.placeholderCount,
argCount,
pattern);
Log4j2-TF-12-AsyncLoggerConfig-8 WARN found 4 argument placeholders, but provided 5 for pattern `{} acquired connection for '{}': {} ({}{@})`
In practice, this makes logging to JDBC impractical unless status logging level is set to ERROR. Note that the code is the same in the latest (as of today) release of version 2.
Log4j version 3 has refactored the classes so I don't know if the issue persists.
Metadata
Metadata
Assignees
Labels
bugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing code
Type
Projects
Status
Done