-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
Current configure_logging() doesn't allow injecting custom structlog processors. This limits flexibility for filtering, redacting, or enriching logs.
Proposal
Add an optional processors parameter to configure_logging():
configure_logging(
level=logging.INFO,
json_format=True,
include_trace=True,
processors=[...], # new
)If processors is not provided, fall back to the default processor chain used now — no breaking changes.
Use cases
- Filtering noisy requests like
GET /metrics - Redacting secrets from logs (e.g., from
locals()in exceptions) - Adding custom context (e.g., user id, team id)
Motivation
Structlog processors are a clean, composable way to implement logging logic. Exposing this as a public parameter enables advanced use cases without monkeypatching or post-filtering (e.g., in Promtail or Loki).
Metadata
Metadata
Assignees
Labels
No labels