-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
8.8-candidateagent-javacommunityIssues and PRs created by the communityIssues and PRs created by the community
Description
I noticed when I was working with the ECS Java loggers that MDC and/or Metadata fields weren't name spaced.
I can see one of three scenario's:
- Make the default namespace be
labels
per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields) - Make the default namespace be
tags
per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields) - Allow for a customized namespace via a configuration parameter.
Here's an example configuration:
<configuration>
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="co.elastic.logging.logback.EcsEncoder">
<serviceName>my-application</serviceName>
<serviceNodeName>my-application-cluster-node</serviceNodeName>
<additionalField>
<key>environment</key>
<value>dev</value>
</additionalField>
</encoder>
</appender>
<logger name="co.elastic" level="DEBUG"/>
<root level="WARN">
<appender-ref ref="Console"/>
</root>
</configuration>
and a resulting output:
{
"@timestamp": "2021-08-31T15:57:11.355Z",
"log.level": "DEBUG",
"message": "Example with the default Meta Data fields.",
"ecs.version": "1.2.0",
"service.name": "my-application",
"service.node.name": "my-application-cluster-node",
"event.dataset": "my-application.log",
"process.thread.name": "main",
"log.logger": "co.elastic.DemoApplication",
"environment": "dev"
}
ChristianCiach
Metadata
Metadata
Assignees
Labels
8.8-candidateagent-javacommunityIssues and PRs created by the communityIssues and PRs created by the community