-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Error logging java.sql.Date #1366
Comments
ppkarwasz
pushed a commit
that referenced
this issue
Mar 22, 2023
ppkarwasz
pushed a commit
that referenced
this issue
Mar 22, 2023
ppkarwasz
pushed a commit
that referenced
this issue
Mar 22, 2023
ppkarwasz
pushed a commit
that referenced
this issue
Mar 22, 2023
theit
pushed a commit
to theit/logging-log4j2
that referenced
this issue
May 30, 2023
theit
pushed a commit
to theit/logging-log4j2
that referenced
this issue
May 30, 2023
theit
pushed a commit
to theit/logging-log4j2
that referenced
this issue
May 30, 2023
LuciferYang
added a commit
to apache/spark
that referenced
this issue
Oct 23, 2023
### What changes were proposed in this pull request? This pr aims upgrade log4j from 2.20.0 to 2.21.0. ### Why are the changes needed? Support for the zstd compression algorithm has been added in the new version: apache/logging-log4j2#1508 | apache/logging-log4j2#1514 Meanwhile, the new version starts to use Java 11 for building, and the runtime version is still compatible with Java 8: apache/logging-log4j2#1369 The new version also brings some bug fixes, such as: - Fixed logging of java.sql.Date objects by appending it before Log4J tries to call java.util.Date.toInstant() on it: apache/logging-log4j2#1366 - Fixed concurrent date-time formatting issue in PatternLayout: apache/logging-log4j2#1485 - Fixed buffer size in Log4jFixedFormatter date time formatter: apache/logging-log4j2#1418 - Fixed the propagation of synchronous action failures in RollingFileManager and FileRenameAction: apache/logging-log4j2#1445 | apache/logging-log4j2#1549 - Fixed RollingFileManager to propagate failed synchronous actions correctly: apache/logging-log4j2#1445 and more. The complete release note is as follows: - https://github.com/apache/logging-log4j2/releases/tag/rel%2F2.21.0 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass GitHub Actions ### Was this patch authored or co-authored using generative AI tooling? No Closes #43478 from LuciferYang/SPARK-45625. Authored-by: yangjie01 <yangjie01@baidu.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When I have an instance of a
java.sql.Date
object and try to log it as a parameterized message, the newest version of Log4J assumes it's a regularjava.util.Date
one and tries to callDate.toInstant()
when logging it. This works forjava.util.Date
and its subclassesjava.sql.Timestamp
andjava.sql.Time
(which uses a specific format for that type), but fails forjava.sql.Date
, as it throws anUnsupportedOperationException
.Configuration
Version: 2.20.0
Logs
Reproduction
log4j2.xml:
JUnit test:
The text was updated successfully, but these errors were encountered: