Skip to content

[improve] PIP-467: Adopt slog for structured logging across Pulsar#25462

Open
merlimat wants to merge 1 commit intoapache:masterfrom
merlimat:pip/pip-467
Open

[improve] PIP-467: Adopt slog for structured logging across Pulsar#25462
merlimat wants to merge 1 commit intoapache:masterfrom
merlimat:pip/pip-467

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

@merlimat merlimat commented Apr 3, 2026

Motivation

Pulsar currently uses SLF4J with string-interpolated log messages, making it difficult to query, filter, and
correlate log data in production environments. PIP-89 previously approved adopting structured logging but the
chosen approach (an in-repo custom library) had limitations.

This PIP proposes adopting slog as a lightweight, high-performance structured
logging facade that integrates with existing Log4j2/SLF4J backends.

Key features

  • Fluent API with structured key-value attributes
  • Derived loggers with persistent context
  • Context composition across component boundaries (e.g., Pulsar → BookKeeper)
  • Zero-allocation disabled path (2.4× faster than Log4j2, 2.8× faster than SLF4J)
  • @CustomLog Lombok integration
  • Auto-detection of Log4j2 or SLF4J backend

PoC

The managed-ledger module has been fully migrated as proof of concept:
merlimat#20

cc @apache/pulsar-committers


  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@merlimat merlimat changed the title PIP-467: Adopt slog for structured logging across Pulsar [pip] PIP-467: Adopt slog for structured logging across Pulsar Apr 3, 2026
@merlimat merlimat changed the title [pip] PIP-467: Adopt slog for structured logging across Pulsar [improve] PIP-467: Adopt slog for structured logging across Pulsar Apr 3, 2026
@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Apr 3, 2026
@apache apache deleted a comment from github-actions bot Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs PIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant