Skip to content

Support for log4j 2.6 #100

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

Merged
merged 4 commits into from
Nov 13, 2020
Merged

Conversation

felixbarny
Copy link
Member

@felixbarny felixbarny commented Oct 30, 2020

2.6 has been released in May 2016

closes #96

This is the earliest version to support builders
@felixbarny felixbarny added this to the 1.0 milestone Oct 30, 2020
@apmmachine
Copy link
Contributor

apmmachine commented Oct 30, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #100 updated]

  • Start Time: 2020-11-11T15:14:55.833+0000

  • Duration: 6 min 17 sec

Test stats 🧪

Test Results
Failed 0
Passed 105
Skipped 4
Total 109

((MultiFormatStringBuilderFormattable) message).formatTo(JSON_FORMAT, messageBuffer);
if (MULTI_FORMAT_STRING_BUILDER_FORMATTABLE.isInstance(message)) {
try {
FORMAT_TO.invoke(message, JSON_FORMAT, messageBuffer);
Copy link
Member Author

Choose a reason for hiding this comment

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

An alternative to invoking this via reflection would be to have an isolated class calling MultiFormatStringBuilderFormattable#formatTo that's only loaded if the class is available.

The downside is that it wouldn't be possible to compile and test against the old version easily. However, we do want to test against the new version so that we can actually test this.

Copy link
Member Author

Choose a reason for hiding this comment

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

An alternative to invoking this via reflection would be to have an isolated class calling MultiFormatStringBuilderFormattable#formatTo that's only loaded if the class is available.

That's what I ended up with now.

The downside is that it wouldn't be possible to compile and test against the old version easily.

There's now a separate log4j2-legacy-tests module that tests against log4j 2.6 while the main module compiles against the most recent version (2.14.0)

@felixbarny felixbarny requested a review from eyalkoren November 11, 2020 12:59
@felixbarny felixbarny changed the title Support for log4j 2.8 Support for log4j 2.7 Nov 11, 2020
@felixbarny felixbarny changed the title Support for log4j 2.7 Support for log4j 2.6 Nov 13, 2020
@felixbarny felixbarny merged commit 70d2f53 into elastic:master Nov 13, 2020
@felixbarny felixbarny deleted the support-log4j2-2.8 branch November 13, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support earlier log4j2 versions
2 participants