Skip to content

Support pluggable logging for structured output and correlation IDs #1741

@maxisbey

Description

@maxisbey

Summary

Allow users to inject their own logger for structured logging, correlation IDs, and integration with their logging infrastructure.

Problem

The SDK uses standard Python logging.getLogger(__name__) which produces unstructured, multi-line output that's hard to correlate in log aggregation systems.

  • Can't correlate logs from a single request when debugging
  • Multi-line log entries break standard log parsing
  • No built-in support for correlation IDs across request lifecycle

Goal

Let users configure a custom logger factory so they can use structured logging (JSON), add correlation IDs, and integrate with tools like structlog.


AI Disclaimer

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureenhancementRequest for a new feature that's not currently supportedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions