elastic / elastic/ecs-logging-java
Add the possibility to process or transform the message
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 148
- フォーク
- 82
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 3
説明
I need to be able to transform some messages. For example obfuscate some information. I want to be able to do that at the encoder level and not before on several components.
Now a days, the encode method add the message using
`event.getFormattedMessage()`
It could be very useful if we can add something similar to the following at the ECSEncoder class:
/**
* Subclasses can override this to format the message (for example to obfuscate some fields.)
* @param event The event to be logged
* @return The message processed. By default, this method return the message without any modification
*/
protected String processMessage (ILoggingEvent event){
return event.getFormattedMessage();
}
And at the encode method
`EcsJsonSerializer.serializeFormattedMessage(builder, processMessage(event));`
What do you think?
The method name could be process, transform, or just getMessage...
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ECSEncoder の encode メソッドから始め、event.getFormattedMessage() と EcsJsonSerializer.serializeFormattedMessage の使用箇所を追跡します。提案されたデフォルト動作を使用してエンコーダーレベルの処理フックを定義し、サブクラスでどのようにオーバーライドすべきかを判断します。メッセージを他のコンポーネントを変更せずにエンコーダーで変換でき、変更されていないメッセージでは現在の動作が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100