elastic / elastic/ecs-logging-java
Allow overriding event.dataset field per event
- 主要言語
- Java
- スター
- 148
- フォーク
- 82
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 3
説明
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.
コントリビューションガイド
調査の方向性
log4j2-ecs-layout の EcsLayout クラスから始め、サービス名と設定値から event.dataset がどのように設定されるかを追跡してください。ContextData/MDC がどのようにシリアライズされるか、またそこで event.dataset を設定すると重複フィールドが生成される理由を確認してください。重複出力なしでサポートされたイベント単位の上書きを定義して実装し、1つのログファイル内で複数のイベントデータセットを扱うカバレッジを追加できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- observability
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100