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

[MarkerResolver] Expose parents as a list under field name parents #1381

Merged
merged 2 commits into from Mar 21, 2023

Conversation

eherot
Copy link
Contributor

@eherot eherot commented Mar 20, 2023

PatternLayout can display the marker's parents with %marker. I thought it would be handy if the JSON Template Layout also had that capability.

Also added tests for the existing MarkerResolver since there weren't any

Additionally:

Slightly modified the TestHelper to catch exceptions in readJson and re-throw with the serialized event, to make it a little easier to debug JSON formatting issues.

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (if it fails due to code formatting issues reported by Spotless, simply run spotless:apply and retry)
  • Changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests for the changes are provided
  • Commits are signed (optional, but highly recommended)

…re-throw with serialized event

This should make it a little easier for people running tests to see if (or rather how) they have screwed up the JSON formatting.
@vy vy self-assigned this Mar 21, 2023
@vy
Copy link
Member

vy commented Mar 21, 2023

Thanks so much for the contribution, @eherot! I will pick this up sometime today.

@vy vy merged commit ef9dea9 into apache:2.x Mar 21, 2023
6 of 7 checks passed
@vy
Copy link
Member

vy commented Mar 21, 2023

@eherot, LGTM, merged. There are some minor changes that needs to be done. This also needs to be ported to main. I will take care of these. Appreciated the detailed work. 🙏

@vy vy added this to the 2.21.0 milestone Mar 21, 2023
@eherot eherot deleted the expose-marker-parents branch March 21, 2023 21:19
vy added a commit that referenced this pull request Mar 21, 2023
vy added a commit that referenced this pull request Mar 21, 2023
vy pushed a commit that referenced this pull request Mar 21, 2023
theit pushed a commit to theit/logging-log4j2 that referenced this pull request May 30, 2023
theit pushed a commit to theit/logging-log4j2 that referenced this pull request May 30, 2023
theit pushed a commit to theit/logging-log4j2 that referenced this pull request May 30, 2023
@ppkarwasz ppkarwasz modified the milestones: 2.21.0, 2.20.1 Aug 1, 2023
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.

None yet

5 participants