-
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
Fix StatusLogger
time-zone issues and stack overflow
#2322
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.
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
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
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
StatusLogger
such thatlog4j2.StatusLogger.DateFormatZone
configuration property is introduced. This sets the time-zoneStatusLogger
uses 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()
.StatusLogger
is improved to avoid stack overflow caused byStatusLogger#logMessage()
failures.These issues are originally reported by @lauredogit here: #2249 (comment)