Skip to content

Fix DatePatternConverter locale parsing when timezone is omitted#4130

Open
ramanathan1504 wants to merge 6 commits into
2.xfrom
fix-4129-locale-without-timezone
Open

Fix DatePatternConverter locale parsing when timezone is omitted#4130
ramanathan1504 wants to merge 6 commits into
2.xfrom
fix-4129-locale-without-timezone

Conversation

@ramanathan1504
Copy link
Copy Markdown
Contributor

Fixes #4129

DatePatternConverter incorrectly interpreted locale-like second arguments (for example de-DE) as timezone IDs when no timezone was provided.
This caused patterns like %d{dd-MMMM-yyyy}{de-DE} to use the JVM default locale instead of the requested locale, producing incorrect localized month names.
This change tightens locale detection so locale tags are correctly recognized in the 2-argument form, while preserving existing behavior for the 3-argument form %d{pattern}{timezone}{locale}.

@ramanathan1504
Copy link
Copy Markdown
Contributor Author

@andrei-ivanov

I think there was a duplicate comment/UI glitch and I may have accidentally removed the thread while cleaning it up. Sorry about that.

but am updated the code as per comments
Screenshot 2026-05-26 at 7 44 47 AM

…dation and add settings for editor configuration
…dation and add settings for editor configuration
@vy vy changed the title Fix DatePatternConverter locale parsing when timezone is omitted Fix DatePatternConverter locale parsing when timezone is omitted May 28, 2026
Copy link
Copy Markdown
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

@ramanathan1504, pattern-layout.adoc needs to be updated. Would you mind doing that too, please?

@github-project-automation github-project-automation Bot moved this to Changes requested in Log4j pull request tracker May 28, 2026
@ramanathan1504 ramanathan1504 requested a review from vy May 28, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Changes requested

Development

Successfully merging this pull request may close these issues.

Log4J pattern layout inconsistencies when locale is specified

2 participants