testcontainers / testcontainers/testcontainers-java
Easier way to configure logging
オープン
まだ誰も着手していません。
resolution/acknowledged
type/feature
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
So by default test containers logs in the following form:
14:42:17.885|INFO |🐳 [gcr.io/etcd-development/etcd:v3.3] - Creating container for image: gcr.io/etcd-development/etcd:v3.3
14:42:18.256|INFO |🐳 [gcr.io/etcd-development/etcd:v3.3] - Starting container with ID: e2f3eb78d0eb6b073271abcf30a76e675fe35f2212684935a36f3a28d4ee9a14
So if I want to log only warning I have to configure i.e. log4j2 as follow:
<Loggers>
<!-- package loggers -->
<Logger name="org.testcontainers" level="INFO" additivity="true"/>
<Logger name="🐳 [gcr.io/etcd-development/etcd:v3.3]" level="WARN" additivity="true"/>
<!-- main logger -->
<Root level="INFO">
<AppenderRef ref="STDOUT" />
</Root>
</Loggers>
Which means that I have to include:
- the bits that generate the docker icon 🐳
- the image name
So if I do upgrade the image or if I need to test against different images, I have to change also the logging configuration if I do not want to see testcontainers logs.
Maybe it is better to put the image name using MDC so one may decide to show it or not.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイル名やテスト名は指定されていません。まず Testcontainers のロギングコードと、ロガー出力にイメージ名がどのように含まれるかを特定し、次に既存のロギング設定と MDC の使用方法を確認してください。イメージ名またはテスト対象のイメージが変わっても設定を変更せずに、イメージ固有のロギングを制御できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, java
- 領域
- observability, testing
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100