Closed Tritpi closed 3 years ago
You shouldn't have to override addCustomDataToJsonMap()
. Note that product_name
is not supposed to appear as a top level attribute of the LogEntry
in the Cloud Logging console. It should appear under jsonPayload
. See: https://cloud.google.com/logging/docs/agent/configuration#process-payload.
Can you share the LogEntry
as it appears in the Logging console?
Closing due to inactivity from OP.
@meltsufin Im trying to add a custom json to get some custom data added in the console appender with StackDriverJsonLayout. Below is the code from logback-spring.xml:
This works in local. But when the application is deployed to GKE and the console logs are checked the custom json field does not appear.
I tried to override the addCustomDataToJsonMap method in a custom class which extends the JsonLayout. But how should this custom class be referred in logback-spring.xml. Also please confirm if this step of overriding the addCustomDataToJsonMap method is really required or not.
Please share an example if possible