Used nested format for ECS structure logging
Update `ElasticCommonSchemaStructuredLogFormatter` implementations so that nested JSON is used for entries that previous has a '.' in the name. This format follows the ECS specification and should be compatible with more backends. Fixes gh-45063
This commit is contained in:
@@ -504,7 +504,7 @@ A log line looks like this:
|
||||
|
||||
[source,json]
|
||||
----
|
||||
{"@timestamp":"2024-01-01T10:15:00.067462556Z","log.level":"INFO","process.pid":39599,"process.thread.name":"main","service.name":"simple","log.logger":"org.example.Application","message":"No active profile set, falling back to 1 default profile: \"default\"","ecs.version":"8.11"}
|
||||
{"@timestamp":"2024-01-01T10:15:00.067462556Z","log":{"level":"INFO","logger":"org.example.Application"},"process":{"pid":39599,"thread":{"name":"main"}},"service":{"name":"simple"},"message":"No active profile set, falling back to 1 default profile: \"default\"","ecs":{"version":"8.11"}}
|
||||
----
|
||||
|
||||
This format also adds every key value pair contained in the MDC to the JSON object.
|
||||
|
||||
Reference in New Issue
Block a user