elastic / elastic/ecs-logging-java

Add the possibility to process or transform the message

オープン
#164 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

agent-java community triage
主要言語
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...

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ECSEncoder の encode メソッドから始め、event.getFormattedMessage() と EcsJsonSerializer.serializeFormattedMessage の使用箇所を追跡します。提案されたデフォルト動作を使用してエンコーダーレベルの処理フックを定義し、サブクラスでどのようにオーバーライドすべきかを判断します。メッセージを他のコンポーネントを変更せずにエンコーダーで変換でき、変更されていないメッセージでは現在の動作が維持されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
backend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。