elastic / elastic/ecs-logging-java
Allow overriding event.dataset field per event
- Lenguaje dominante
- Java
- Estrellas
- 148
- Forks
- 82
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 3
Descripción
Currently the EcsLayout class in `log4j2-ecs-layout` defaults the `event.dataset` to the service name + ".log". At most we can override it with a specific value, but that specific value will be written for every log line.
In the project I am working on we are generating multiple kinds of events into a single log file, including access, egress, trace and logs. We want to be able to differentiate these events by the `event.dataset` field as required by an internal observability team but we can't set/override that field per event. If we set it in ContextData/MDC manually it causes the field to be written twice.
I can understand trying to negotiate the event context data per event before writing out standard fields might be opening a can of worms but I'd like to have the conversation as to how situations like this could be handled.
Guía de contribución
Línea de trabajo
Comience con la clase EcsLayout en log4j2-ecs-layout y rastree cómo se rellena event.dataset a partir del nombre del servicio y del valor configurado. Revise cómo se serializa ContextData/MDC y por qué establecer event.dataset allí produce campos duplicados. Se considera terminado cuando se haya definido e implementado una sobrescritura por evento compatible sin salida duplicada, con cobertura para múltiples datasets de eventos en un único archivo de log.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- observability
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100