apache / apache/bookkeeper

BP-69: Adopt slog for structured logging

Open
#4,750 0 comments 0 reactions 0 assignees View on GitHub
BP
Dominant language
Java
Stars
2k
Forks
976
Avg merge
6d 15h
Merged PRs (30d)
7

Description

Master tracking issue for **BP-69: Adopt slog for structured logging**.

### Summary

Adopt the [slog](https://github.com/merlimat/slog) library for structured logging across the BookKeeper codebase, replacing the ad-hoc SLF4J `{}`-style format strings. Retire the existing, barely-used `bookkeeper-slogger` module. Add an API for callers (Pulsar, applications, tools) to attach their own logging context attributes to a ledger `Handle` so cross-boundary log lines stay structured and correlated.

This mirrors the decision made upstream in Apache Pulsar [PIP-467](https://github.com/apache/pulsar/blob/master/pip/pip-467.md), whose migration is complete.

### Proposal

See the full proposal at `site3/website/src/pages/bps/BP-69-slog-structured-logging.md` (PR forthcoming).

### Implementation

Migration will be done in phases, one module per commit, each independently mergeable:

- [ ] Phase 1: `bookkeeper-common`
- [ ] Phase 2: `stats`, `bookkeeper-common-allocator`
- [ ] Phase 3: `bookkeeper-server` (core, largest phase)
- [ ] Phase 4: `bookkeeper-http`, `tools`
- [ ] Phase 5: `stream/distributedlog`
- [ ] Phase 6: `metadata-drivers`, `benchmark`, peripheral tests
- [ ] Phase 7: Cleanup — remove `bookkeeper-slogger`, remove `@Slf4j` usage
- [ ] Client API: `withLoggerContext(Map)` on `CreateBuilder`, `OpenBuilder`, `DeleteBuilder`

Sub-PRs will be linked here as they are opened.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.