Skip to content

Feature Request: Add built-in logger hooks for all HTTP requests and responses #7079

Description

@Amanlook

It would be helpful if the requests library provided an easy and consistent way to log every outgoing request and incoming response without manually wrapping or subclassing Session objects.

Motivation

Many developers (especially in production systems, microservices, and debugging tools) need to:

Trace outgoing requests (URLs, methods, headers, payloads)

Log response details (status code, latency, headers, etc.)

Integrate logs with frameworks like logging, structlog, or jsonlogger

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions