Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Design optional logforth-registry for configuration-driven logger lookup

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
rust
領域
observability

調査の方向性

実装ファイルやテストは指定されていません。まず #214 の global-logger の変更と logforth-core の境界を確認し、次に issue にリンクされている Log4j と Logback の設定リファレンスを比較してください。実装を開始する前に、registry crate の API、selector model、configuration format、caching behavior、core boundary について合意できていれば完了です。

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

説明

enhancement

Background

We are removing/rethinking the global default logger (#214). That keeps the core API explicit, but applications may still want a startup-provided, process-wide way to look up and reuse loggers without passing a Logger instance through every layer.

A future optional crate, tentatively named logforth-registry, could provide this capability. The idea is similar in spirit to OpenDAL-style registries: users provide a registry configuration, and application code can resolve a named/model/target-specific logger from that registry.

Goals

  • Provide an optional global registry that can be initialized at application startup.
  • Load logger definitions from a config file and/or programmatic registry settings.
  • Select loggers by dimensions such as target, module/logger name, app-defined model name, profile/tenant, or other selector settings.
  • Support a fallback root logger when no more specific logger matches.
  • Cache constructed logger instances in the registry so callers can reuse them without rebuilding pipelines or passing handles everywhere.
  • Support per-model/per-target logger relationships, including inheritance or fallback behavior where appropriate.
  • Keep this outside the core logger path so we do not recreate an implicit default global logger in logforth-core.

Prior art to study

These are not direct API models for Rust, but they are useful references for:

  • config-file shape and stability;
  • root logger fallback;
  • target/logger-name based selection;
  • appender/layout/filter references;
  • additivity/inheritance-like behavior;
  • runtime reload or replacement questions.

Sketch

A registry config might declare reusable appenders/layouts/filters, logger definitions, selector rules, and a root logger:

[root]
logger = "console"

[[loggers]]
name = "console"
selector.target = "*"
appenders = ["stdout"]

[[loggers]]
name = "model-a-file"
selector.model = "model-a"
selector.target = "my_crate::model_a::*"
appenders = ["rolling_file"]

The exact format is intentionally undecided. The important part is that the registry can map runtime lookup input to a cached logger instance:

let registry = logforth_registry::Registry::from_config(config)?;
logforth_registry::set_global(registry)?;

let logger = logforth_registry::get(LoggerSelector::new()
    .target("my_crate::model_a::worker")
    .setting("model", "model-a"));

Open questions

  • Should logforth-registry expose only explicit Registry values, or also provide a global singleton API?
  • What should the selector model look like: target/module path only, arbitrary key-value dimensions, typed dimensions, or a combination?
  • How should logger inheritance/additivity work, if at all?
  • What is the minimum useful config format: TOML, YAML, JSON, or format-agnostic serde data structures?
  • Should registry entries build full Logger values eagerly at startup, lazily on first lookup, or support both?
  • How should reload/reconfiguration work without surprising existing cached handles?
  • How should this interact with the log bridge and any future tracing-style bridge?
  • What belongs in logforth-core as reusable primitives, and what should remain in the optional registry crate?

Non-goals

  • Reintroducing a mandatory default global logger in core.
  • Making all applications configure logging through a registry.
  • Locking in a Log4j/Logback-compatible configuration syntax.
主要言語
Rust
スター
238
フォーク
31
平均マージ
3時間 4分
マージ済み PR(30日)
1

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

fast/logforth のほかの issue

fast/logforth の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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