Skip to content

🧩 Support for structlog processors in configure_logging #15

@deus-developer

Description

@deus-developer

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions