rturner-edjuster opened a new issue, #1400:
URL: https://github.com/apache/logging-log4j2/issues/1400
## Description
When logging java.sql.Date objects, an UnsupportedOperationException is
thrown. Change for LOG4J2-2297 may have introduced this fault.
## Configuration
**Version:** 2.20.0
(worked in 2.19.0)
**Operating system:** MacOS 13.2.1
**JDK:** Corretto 18
openjdk 18.0.2 2022-07-19
OpenJDK Runtime Environment Corretto-18.0.2.9.1 (build 18.0.2+9-FR)
OpenJDK 64-Bit Server VM Corretto-18.0.2.9.1 (build 18.0.2+9-FR, mixed mode,
sharing)
## Logs
```
Caused by: java.lang.UnsupportedOperationException
at java.sql/java.sql.Date.toInstant(Date.java:316)
at
org.apache.logging.log4j.message.ParameterFormatter.appendDate(ParameterFormatter.java:492)
at
org.apache.logging.log4j.message.ParameterFormatter.appendSpecialTypes(ParameterFormatter.java:485)
at
org.apache.logging.log4j.message.ParameterFormatter.recursiveDeepToString(ParameterFormatter.java:474)
at
org.apache.logging.log4j.message.ParameterFormatter.recursiveDeepToString(ParameterFormatter.java:449)
at
org.apache.logging.log4j.message.ParameterFormatter.formatMessage2(ParameterFormatter.java:192)
at
org.apache.logging.log4j.message.ParameterizedMessage.formatTo(ParameterizedMessage.java:227)
```
## Reproduction
final java.sql.Date date = new java.sql.Date(2023, 03, 28):
logger.info("Date: {}", date); // crashes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]