Skip to content
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

Merged
merged 9 commits into from Feb 27, 2024
Merged

Conversation

vy
Copy link
Member

@vy vy commented Feb 23, 2024

This PR improves StatusLogger such that

  1. A new log4j2.StatusLogger.DateFormatZone configuration property is introduced. This sets the time-zone StatusLogger uses to format java.time.Instant. Without this formatting patterns accessing to time-zone-specific fields (e.g., year-of-era) cause failures. The value defaults to ZoneId.systemDefault().
  2. StatusLogger is improved to avoid stack overflow caused by StatusLogger#logMessage() failures.

These issues are originally reported by @lauredogit here: #2249 (comment)

Without a time-zone, it is not possible to format certain date & time
fields that are time-zone-specific, e.g., year-of-era.
@vy vy added bug Incorrect, unexpected, or unintended behavior of existing code api Affects the public API labels Feb 23, 2024
@vy vy added this to the 2.23.1 milestone Feb 23, 2024
@vy vy requested a review from ppkarwasz February 23, 2024 21:23
@vy vy self-assigned this Feb 23, 2024
Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@rgoers rgoers left a 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.

Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vy vy merged commit af045db into 2.x Feb 27, 2024
9 checks passed
@vy vy deleted the 2.x-StatusLogger-fix branch February 27, 2024 20:59
vy added a commit that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the public API bug Incorrect, unexpected, or unintended behavior of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants