Restore support for documented Rfc5424Layout attributes#4074
Merged
Restore support for documented Rfc5424Layout attributes#4074
Rfc5424Layout attributes#4074Conversation
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>
Contributor
There was a problem hiding this comment.
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
Rfc5424Layoutattribute names (newLine,newLineEscape,mdcIncludes/mdcExcludes/mdcRequired,useTlsMessageFormat) alongside existing compatibility aliases. - Add tests that build
Rfc5424Layoutvia 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.
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java
Show resolved
Hide resolved
log4j-core-test/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vy
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
2.21.0,Rfc5424Layoutwas 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.0for backward compatibility.Fixes #4022