Replies: 1 comment
-
Here's my 2c on this. If you are trying to add cross cutting data to your logging system (maybe via an AOP, or a superclass) than that's more than fine IMO. Unfortunately currently the customJson is not implemented, and it should be removed, my bad for leaving a trace of bad code there. So what are the options:
This would follow the logback joran's model of setting complex properties. But I honestly question this approach in lieu of using the first one, because the value would be printed for every call and its not dynamic |
Beta Was this translation helpful? Give feedback.
-
I want to add more attributes like "body" into the jsonPayload object like:
I see this field https://github.com/micronaut-projects/micronaut-gcp/blob/master/gcp-logging/src/main/java/io/micronaut/gcp/logging/StackdriverJsonLayout.java#L49
but i don't know how to use it.
I tried:
But
customJson
is still null.I saw that I can use
MDC.getMDCAdapter().put("test", "test")
and I can write in the jsonPayload.My question: is it ok to use it like this?
Beta Was this translation helpful? Give feedback.
All reactions