elastic / elastic/ecs-logging-java
Allow overriding event.dataset field per event
- Langage dominant
- Java
- Étoiles
- 148
- Forks
- 82
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 3
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la classe EcsLayout dans log4j2-ecs-layout et retracez la manière dont event.dataset est renseigné à partir du nom du service et de la valeur configurée. Examinez comment ContextData/MDC est sérialisé et pourquoi définir event.dataset à cet endroit produit des champs en double. Le travail est terminé lorsqu’une surcharge par événement prise en charge est définie et implémentée sans sortie en double, avec une couverture pour plusieurs datasets d’événements dans un même fichier de log.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- observability
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100