Skip to content

Add configurable request and response logging #306

Description

@jbeckwith-oai

Carried over from #126 and originally requested by @akshah123.

The client currently has no supported way to inject a logger such as Rails.logger and observe outgoing requests and incoming responses. A logger integration would help applications debug API behavior and correlate SDK traffic with their own logs.

Desired behavior

  • Accept a standard Ruby logger-compatible object at client construction (including Rails.logger).
  • Log useful request and response metadata with configurable verbosity.
  • Redact authorization credentials and other sensitive headers by default.
  • Make body/payload logging explicit and safe, especially for file uploads and streaming responses.
  • Include request IDs, status, timing, and retry information where available.
  • Document the feature and add tests for redaction and streaming behavior.

Related: #242 tracks a narrower request for retry callbacks/visibility. Source: #126.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgeneratorTouches generated SDK files

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions