{"id":15442034,"url":"https://github.com/kludex/asgi-logger","last_synced_at":"2025-07-16T07:38:30.079Z","repository":{"id":39316529,"uuid":"416087518","full_name":"Kludex/asgi-logger","owner":"Kludex","description":"Access logger for ASGI servers! :tada:","archived":false,"fork":false,"pushed_at":"2024-01-05T12:11:02.000Z","size":141,"stargazers_count":51,"open_issues_count":14,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T02:09:54.295Z","etag":null,"topics":["asgi","asgi-middleware","logger","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kludex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-11T21:09:33.000Z","updated_at":"2025-04-04T04:13:52.000Z","dependencies_parsed_at":"2024-06-19T00:13:16.093Z","dependency_job_id":"89bd0044-3666-4502-83c4-14d53b5bbae7","html_url":"https://github.com/Kludex/asgi-logger","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"3247a1ac80658b3e42880f91eaeb02065ce8f1b1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fasgi-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fasgi-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fasgi-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fasgi-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kludex","download_url":"https://codeload.github.com/Kludex/asgi-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654090,"owners_count":21140236,"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":["asgi","asgi-middleware","logger","uvicorn"],"created_at":"2024-10-01T19:24:49.153Z","updated_at":"2025-04-13T02:10:09.562Z","avatar_url":"https://github.com/Kludex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    \u003cstrong\u003easgi-logger\u003c/strong\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Kludex/asgi-logger\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/last-commit/Kludex/asgi-logger\" alt=\"Latest Commit\"\u003e\n    \u003c/a\u003e\n        \u003cimg src=\"https://img.shields.io/github/workflow/status/Kludex/asgi-logger/Test\"\u003e\n        \u003cimg src=\"https://img.shields.io/codecov/c/github/Kludex/asgi-logger\"\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://pypi.org/project/asgi-logger\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/asgi-logger\" alt=\"Package version\"\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/asgi-logger\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/Kludex/asgi-logger\"\u003e\n\u003c/p\u003e\n\nThis project was created as an alternative for the current uvicorn logger. But it can also be used with any other ASGI server.\n\n\n## Installation\n\n``` bash\npip install asgi-logger\n```\n\n## Usage\n\nIf you're using it with uvicorn, remember that you need to erase the handlers from uvicorn's logger that is writing the access logs.\nTo do that, just:\n\n```python\nlogging.getLogger(\"uvicorn.access\").handlers = []\n```\n\nBelow you can see an example with FastAPI, but you can use it with any other ASGI application:\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi.middleware import Middleware\nfrom asgi_logger import AccessLoggerMiddleware\n\napp = FastAPI(middleware=[Middleware(AccessLoggerMiddleware)])\n\n@app.get(\"/\")\nasync def home():\n    return \"Hello world!\"\n```\n\nIn case you want to add a custom format to the access logs, you can do it using the `format` parameter on the `AccessLoggerMiddleware`:\n\n```python\nAccessLoggerMiddleware(app, format=\"%(s)s\")\n```\n\nFor now you can verify the possible format values [here](https://github.com/Kludex/asgi-logger/blob/main/asgi_logger/middleware.py).\nThe documentation will be available soon.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkludex%2Fasgi-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkludex%2Fasgi-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkludex%2Fasgi-logger/lists"}