merlimat opened a new pull request, #4751:
URL: https://github.com/apache/bookkeeper/pull/4751
### Motivation
This PR adds **BP-69: Adopt slog for structured logging** for discussion.
BookKeeper currently uses SLF4J with unstructured `{}`-style format strings.
This makes logs hard to query in modern log backends (Loki, Elastic, Splunk,
etc.), forces every call site to restate identity context (ledgerId, bookieId,
entryId, …) inline, and requires `isDebugEnabled()` guards on hot paths to
avoid `String.format`/`toString` cost.
[Apache Pulsar
PIP-467](https://github.com/apache/pulsar/blob/master/pip/pip-467.md) reached
the same conclusion, chose the [slog](https://github.com/merlimat/slog)
library, and its migration is complete. Because Pulsar is BookKeeper's largest
user, a shared logging substrate lets cross-project debugging chains stay
structured end-to-end.
The BP also covers retiring the existing `bookkeeper-slogger` module (only 5
main-source files use it, all in `bookkeeper-server`), and adds an API for
callers to attach their own context attributes to a ledger `Handle` via
`withLoggerContext(Map<String, Object>)` on
`CreateBuilder`/`OpenBuilder`/`DeleteBuilder` — so e.g. Pulsar's
`managedLedger=<topic>` attribute can appear automatically on BookKeeper client
log lines without BookKeeper knowing about Pulsar concepts.
Tracking issue: #4750
### Summary
- New BP document:
`site3/website/src/pages/bps/BP-69-slog-structured-logging.md`
- Listed as `Under Discussion` in
`site3/website/src/pages/community/bookkeeper-proposals.md`
- Next proposal number bumped to 70
- This PR is **not** associated with any release or milestone (per BP
process)
### Test plan
- [ ] N/A — proposal document only
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]