{"id":21714750,"url":"https://github.com/r-m-n/httpx-structlog","last_synced_at":"2025-10-07T08:32:59.350Z","repository":{"id":248256369,"uuid":"828204464","full_name":"r-m-n/httpx-structlog","owner":"r-m-n","description":"Сustom httpx client that logs all requests and responses with structlog","archived":false,"fork":false,"pushed_at":"2024-12-13T16:47:19.000Z","size":33,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T20:53:15.317Z","etag":null,"topics":["httpx","logging","structlog"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-m-n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-13T12:31:33.000Z","updated_at":"2025-01-20T14:57:46.000Z","dependencies_parsed_at":"2024-10-31T14:19:28.415Z","dependency_job_id":"ee8a8d1a-e46a-4363-9b1b-b028945ec1b3","html_url":"https://github.com/r-m-n/httpx-structlog","commit_stats":null,"previous_names":["r-m-n/httpx-logging-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-m-n%2Fhttpx-structlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-m-n%2Fhttpx-structlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-m-n%2Fhttpx-structlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-m-n%2Fhttpx-structlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-m-n","download_url":"https://codeload.github.com/r-m-n/httpx-structlog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235611632,"owners_count":19018103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["httpx","logging","structlog"],"created_at":"2024-11-26T00:38:33.579Z","updated_at":"2025-10-07T08:32:54.034Z","avatar_url":"https://github.com/r-m-n.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![PyPI - Version](https://img.shields.io/pypi/v/httpx-structlog)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/httpx-structlog)\n\n\n# httpx-structlog\n\nСustom httpx client that logs all requests and responses with structlog.\n\n## Installation\n\nInstall using `pip`:\n\n```shell\n$ pip install httpx-structlog\n```\n\n## Usage\n\n```python\nfrom httpx_structlog import AsyncLoggingClient, LoggingClient\n\n# configure structlog\n# structlog.configure(\n#     processors=[structlog.processors.JSONRenderer(sort_keys=True, indent=4)]\n# )\n\n# Sync client\nwith LoggingClient() as client:\n    client.get(\"https://httpbin.org/uuid\")\n\n\n# Async client\nasync with AsyncLoggingClient() as client:\n    await client.get(\"https://httpbin.org/uuid\")\n```\n\n## Log example\n\n```json\n{\n    \"duration\": 0.49533109995536506,\n    \"event\": \"httpx request\",\n    \"host\": \"httpbin.org\",\n    \"method\": \"GET\",\n    \"path\": \"/uuid\",\n    \"request_body\": \"\",\n    \"request_headers\": {\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"connection\": \"keep-alive\",\n        \"host\": \"httpbin.org\",\n        \"user-agent\": \"python-httpx/0.27.0\"\n    },\n    \"request_query\": \"\",\n    \"response_body\": \"{\\n  \\\"uuid\\\": \\\"36a2c551-8632-4712-8b56-d3e21819c04e\\\"\\n}\\n\",\n    \"response_headers\": {\n        \"access-control-allow-credentials\": \"true\",\n        \"access-control-allow-origin\": \"*\",\n        \"connection\": \"keep-alive\",\n        \"content-length\": \"53\",\n        \"content-type\": \"application/json\",\n        \"date\": \"Sat, 13 Jul 2024 12:22:17 GMT\",\n        \"server\": \"gunicorn/19.9.0\"\n    },\n    \"response_status\": 200\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-m-n%2Fhttpx-structlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-m-n%2Fhttpx-structlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-m-n%2Fhttpx-structlog/lists"}