-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix StatusLogger time-zone issues and stack overflow
#2322
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
Conversation
Without a time-zone, it is not possible to format certain date & time fields that are time-zone-specific, e.g., year-of-era.
ppkarwasz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
Outdated
Show resolved
Hide resolved
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
Outdated
Show resolved
Hide resolved
rgoers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property name change is pretty minor. Everything else looks good.
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
Show resolved
Hide resolved
ppkarwasz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR improves
StatusLoggersuch thatlog4j2.StatusLogger.DateFormatZoneconfiguration property is introduced. This sets the time-zoneStatusLoggeruses to formatjava.time.Instant. Without this formatting patterns accessing to time-zone-specific fields (e.g., year-of-era) cause failures. The value defaults toZoneId.systemDefault().StatusLoggeris improved to avoid stack overflow caused byStatusLogger#logMessage()failures.These issues are originally reported by @lauredogit here: #2249 (comment)