Skip to content

Restore support for documented Rfc5424Layout attributes#4074

Merged
ppkarwasz merged 6 commits into2.25.xfrom
fix/2.25.x/rfc5424-param-names
Mar 24, 2026
Merged

Restore support for documented Rfc5424Layout attributes#4074
ppkarwasz merged 6 commits into2.25.xfrom
fix/2.25.x/rfc5424-param-names

Conversation

@ppkarwasz
Copy link
Copy Markdown
Contributor

In 2.21.0, Rfc5424Layout was migrated from a factory method to the builder pattern. During this change, the recognized names of several configuration attributes unintentionally diverged from the documented ones.

As a result, some documented attributes were no longer recognized, while new, undocumented names were introduced.

This change restores support for the documented attribute names while continuing to accept the names introduced in 2.21.0 for backward compatibility.

Fixes #4022

In `2.21.0`, `Rfc5424Layout` was migrated from a factory method to the builder pattern. During this change, the recognized names of several configuration attributes unintentionally diverged from the documented ones.

As a result, some documented attributes were no longer recognized, while new, undocumented names were introduced.

This change restores support for the documented attribute names while continuing to accept the names introduced in `2.21.0` for backward compatibility.

Fixes #4022

Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Restores Rfc5424Layout XML/config attribute name compatibility after the 2.21.0 builder migration, re-accepting documented attribute names while keeping 2.21.0-introduced aliases for backward compatibility.

Changes:

  • Add documented Rfc5424Layout attribute names (newLine, newLineEscape, mdcIncludes/mdcExcludes/mdcRequired, useTlsMessageFormat) alongside existing compatibility aliases.
  • Add tests that build Rfc5424Layout via the plugin system to verify both documented names and aliases are accepted.
  • Add a changelog entry for issue #4022.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/changelog/.2.x.x/4022_rfc5424-param-names.xml Adds changelog entry documenting the fix.
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java Restores documented attribute names in the builder and maps aliases for compatibility.
log4j-core-test/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java Adds plugin-builder-based tests to ensure both documented attributes and compatibility aliases work.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ppkarwasz and others added 2 commits March 24, 2026 20:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vy vy added this to the 2.25.4 milestone Mar 24, 2026
@vy vy added bug Incorrect, unexpected, or unintended behavior of existing code layouts Affects one or more Layout plugins labels Mar 24, 2026
@ppkarwasz ppkarwasz merged commit 6c8cf59 into 2.25.x Mar 24, 2026
7 checks passed
@ppkarwasz ppkarwasz deleted the fix/2.25.x/rfc5424-param-names branch March 24, 2026 23:56
@github-project-automation github-project-automation bot moved this from Approved to Merged in Log4j pull request tracker Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Incorrect, unexpected, or unintended behavior of existing code layouts Affects one or more Layout plugins

Projects

Development

Successfully merging this pull request may close these issues.

3 participants