elastic / elastic/ecs-logging-java
Namespace MDC Fields with either labels or tags.
- 主要语言
- Java
- 星标
- 148
- 派生
- 82
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 3
描述
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:
1. Make the default namespace be `labels` per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields)
2. Make the default namespace be `tags` per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields)
3. Allow for a customized namespace via a configuration parameter.
Here's an example configuration:
```xml
my-application
my-application-cluster-node
environment
dev
```
and a resulting output:
```json
{
"@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"
}
```
贡献指南
调研方向
从 logback EcsEncoder 配置开始,检查 MDC 和 Metadata 字段是如何输出的。将当前 JSON 结构与 ECS 的 labels 和 tags 替代方案进行比较,然后确定实现应使用默认 namespace,还是公开一个可配置的 namespace。namespace 行为达成一致且示例输出反映了该行为后,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- observability-sre
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100