apache / apache/logging-admin

Specify behavior of `LoggingAdmin.getInstance()`

Đang mở
#1 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với API LoggingAdmin.getInstance() và hành vi ContextBindings.bindContext của Tomcat được đề cập. Issue không nêu tên tệp hay test nào; công việc được hoàn tất khi token, phạm vi của classloader và hành vi của context dùng chung so với context cô lập được thống nhất và ghi lại một cách rõ ràng, đồng thời phạm vi triển khai được xác định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api, observability
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.