Skip to content

Is JsonLayout allow to manipulate logevent such as PatternLayout? #1814

Answered by vy
Sangaibisi asked this question in Q&A
Discussion options

You must be logged in to vote

@Sangaibisi, I think you might need to re-think your approach here. Let me elaborate on that.

Assume you have no restrictions on the schema. You might end up having documents as follows:

{"message": "foo", "request": "bar", "response": "buzz"}
{"message": {"message": "foo", "request": "bar", "response": "buzz"}}
{"message": {"message": "foo", "request": "bar", "response": "buzz", "custom-field-added-by-programmer": "doh"}}

Sounds far fetched? Certainly not. Consider the following statements:

log.info("foo");
log.info(new StringMapMessage().with("message", "foo"));
log.info(new StringMapMessage().with("message", "foo").with("custom-field-added-by-programmer", "doh"));

I can share more ed…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@garydgregory
Comment options

@vy
Comment options

vy Sep 23, 2023
Collaborator

Comment options

vy
Sep 23, 2023
Collaborator

You must be logged in to vote
2 replies
@Sangaibisi
Comment options

@vy
Comment options

vy Sep 25, 2023
Collaborator

Answer selected by Sangaibisi
Comment options

You must be logged in to vote
1 reply
@ppkarwasz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants