apache / apache/logging-admin

Specify behavior of `LoggingAdmin.getInstance()`

未关闭
#1 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

The current design of `LoggingAdmin.getInstance()` requires a token, conceptually similar to Tomcat’s [`ContextBindings.bindContext`](https://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/naming/ContextBindings.html#bindContext(java.lang.Object,javax.naming.Context,java.lang.Object)). This token mechanism was introduced to prevent libraries from unintentionally overriding an application’s logging configuration.

### Limitations of the Current Approach

This token-based protection is inherently **opt-in**, which makes it unreliable. Libraries can—and often do—interact directly with the underlying logging framework (e.g., Logback, Log4j2). As a result, the intended protection is easily circumvented, especially in environments where multiple applications or libraries share a common logging context.

### Proposed Direction

To create a more effective and resilient mechanism, we should consider shifting away from opt-in tokens toward a **cooperative, classloader-aware model**. For example, the logging system could expose metadata indicating whether the logger context is scoped:

* **Per web application** (isolated)
* **Globally** (shared across apps)

This information would enable frameworks like Spring Boot to detect shared contexts and conditionally **disable logging auto-configuration** to avoid overriding the shared settings.

### Goals

* Eliminate reliance on opt-in tokens for logging protection
* Support classloader-aware logging context scoping
* Enable frameworks to behave appropriately in shared vs. isolated environments

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 LoggingAdmin.getInstance() API 以及所引用的 Tomcat ContextBindings.bindContext 行为开始。该 issue 未指定文件或测试;当明确约定并记录 token、classloader 作用域,以及共享 context 与隔离 context 的行为,并确定实现范围后,工作即告完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api, observability
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。