Skip to content

Feature Request: Implement Request Logging Options #141

Closed
@LaikaN57

Description

@LaikaN57

Issue Summary

We should implement request logging. SendGrid support will frequent want this information when helping customers debug their application. This information should include what API they are calling, what response code, and what error message we get back.

Possible Solutions

  1. Natively create a logging.Logger object.
  2. Switch to using urllib3 instead of urllib as it has a logging.Logger which can be configured.
  3. Add an option to be able to pass a custom urllib.requests.OpenerDirector or similar.
  4. A workaround I found was setting http.client.HTTPConnection.debuglevel = 1 but this did not seem to work for me in an AWS lambda environment. (I still need to investigate if there is an issue with my code on this though.)

I welcome feedback and would like to know if the community has any objections to adding dependencies (option 1) or changing dependencies (option 2) as I think these are the simplest methods.

Technical details:

  • python-http-client version: 3.2.7
  • python version: 3.7.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions