Can I make all log fields (contextMap) of java logger to be in the same hierarchy?

33 Views Asked by At

I am trying to make my logs standardized, and I am using the ThreadContext in java logger.

I have the output of {"timestamp":..., "message":"...", "contextMap":{...}}

How can I move the fields inside the contextMap to be outside? In the same hierarchy like timestamp & message? I do not want to have nested json objects in those messages.

I know it's possible in TypeScript, but cannot find a way to do that with ThreadContext, although it sounds very basic. Is there any option? How?

0

There are 0 best solutions below