{"id":13460173,"url":"https://github.com/hynek/structlog","last_synced_at":"2025-05-12T05:15:59.285Z","repository":{"id":39633684,"uuid":"12085960","full_name":"hynek/structlog","owner":"hynek","description":"Simple, powerful, and fast logging for Python.","archived":false,"fork":false,"pushed_at":"2025-05-09T07:02:21.000Z","size":5677,"stargazers_count":3948,"open_issues_count":38,"forks_count":242,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-05-12T02:43:17.106Z","etag":null,"topics":["logging","python","structured-logging"],"latest_commit_sha":null,"homepage":"https://www.structlog.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hynek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"hynek","tidelift":"pypi/structlog"}},"created_at":"2013-08-13T15:55:58.000Z","updated_at":"2025-05-11T16:24:02.000Z","dependencies_parsed_at":"2024-01-03T15:45:16.313Z","dependency_job_id":"a97e3546-5a5f-415a-a6c6-41936666a6aa","html_url":"https://github.com/hynek/structlog","commit_stats":{"total_commits":1602,"total_committers":125,"mean_commits":12.816,"dds":"0.16479400749063666","last_synced_commit":"f3e6fdee0658e9c6ab89aaa8823abe0d78e49b3a"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hynek%2Fstructlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hynek%2Fstructlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hynek%2Fstructlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hynek%2Fstructlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hynek","download_url":"https://codeload.github.com/hynek/structlog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672675,"owners_count":21945479,"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":["logging","python","structured-logging"],"created_at":"2024-07-31T10:00:36.775Z","updated_at":"2025-05-12T05:15:59.255Z","avatar_url":"https://github.com/hynek.png","language":"Python","readme":"# *structlog*: Structured Logging for Python\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://www.structlog.org/\"\u003e\n      \u003cimg src=\"docs/_static/structlog_logo.svg\" width=\"35%\" alt=\"structlog: Structured Logging for Python\" /\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://www.structlog.org/en/stable/?badge=stable\"\u003e\u003cimg src=\"https://img.shields.io/badge/Docs-Read%20The%20Docs-black\" alt=\"Documentation\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/hynek/structlog/blob/main/COPYRIGHT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT%2FApache--2.0-C06524\" alt=\"License: MIT / Apache 2.0\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://bestpractices.coreinfrastructure.org/projects/6560\"\u003e\u003cimg src=\"https://bestpractices.coreinfrastructure.org/projects/6560/badge\"\u003e\u003c/a\u003e\n   \u003ca href=\"https://doi.org/10.5281/zenodo.7353739\"\u003e\u003cimg src=\"https://zenodo.org/badge/DOI/10.5281/zenodo.7353739.svg\" alt=\"DOI\"\u003e\u003c/a\u003e\n   \u003ca href=\"https://pypi.org/project/structlog/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/structlog.svg\" alt=\"Supported Python versions of the current PyPI release.\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://pepy.tech/project/structlog\"\u003e\u003cimg src=\"https://static.pepy.tech/personalized-badge/structlog?period=month\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads%20/%20Month\" alt=\"Downloads per month\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cem\u003eSimple. Powerful. Fast. Pick three.\u003c/em\u003e\u003c/p\u003e\n\n\u003c!-- begin-short --\u003e\n\n*structlog* is *the* production-ready logging solution for Python:\n\n- **Simple**: Everything is about **functions** that take and return **dictionaries** – all hidden behind **familiar APIs**.\n- **Powerful**: Functions and dictionaries aren’t just simple but also powerful.\n  *structlog* leaves *you* in control.\n- **Fast**: *structlog* is not hamstrung by designs of yore.\n  Its flexibility comes not at the price of performance.\n\nThanks to its flexible design, *you* choose whether you want *structlog* to take care of the **output** of your log entries or whether you prefer to **forward** them to an existing logging system like the standard library's `logging` module.\n\nThe output format is just as flexible and *structlog* comes with support for JSON, [*logfmt*](https://brandur.org/logfmt), as well as pretty console output out-of-the-box:\n\n[![image](https://github.com/hynek/structlog/blob/main/docs/_static/console_renderer.png?raw=true)](https://github.com/hynek/structlog/blob/main/docs/_static/console_renderer.png?raw=true)\n\n\n## Sponsors\n\n*structlog* would not be possible without our [amazing sponsors](https://github.com/sponsors/hynek).\nEspecially those generously supporting us at the *The Organization* tier and higher:\n\n\u003c!-- pause-short --\u003e\n\n\u003cp align=\"center\"\u003e\n\n\u003c!-- [[[cog\nimport pathlib, tomllib\n\nfor sponsor in tomllib.loads(pathlib.Path(\"pyproject.toml\").read_text())[\"tool\"][\"sponcon\"][\"sponsors\"]:\n      print(f'\u003ca href=\"{sponsor[\"url\"]}\"\u003e\u003cimg title=\"{sponsor[\"title\"]}\" src=\"docs/_static/sponsors/{sponsor[\"img\"]}\" width=\"190\" /\u003e\u003c/a\u003e')\n]]] --\u003e\n\u003ca href=\"https://www.variomedia.de/\"\u003e\u003cimg title=\"Variomedia AG\" src=\"docs/_static/sponsors/Variomedia.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://tidelift.com/?utm_source=lifter\u0026utm_medium=referral\u0026utm_campaign=hynek\"\u003e\u003cimg title=\"Tidelift\" src=\"docs/_static/sponsors/Tidelift.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://klaviyo.com/\"\u003e\u003cimg title=\"Klaviyo\" src=\"docs/_static/sponsors/Klaviyo.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://privacy-solutions.org/\"\u003e\u003cimg title=\"Privacy Solutions\" src=\"docs/_static/sponsors/Privacy-Solutions.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.emsys-renewables.com/\"\u003e\u003cimg title=\"emsys renewables\" src=\"docs/_static/sponsors/emsys-renewables.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://filepreviews.io/\"\u003e\u003cimg title=\"FilePreviews\" src=\"docs/_static/sponsors/FilePreviews.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://polar.sh/\"\u003e\u003cimg title=\"Polar\" src=\"docs/_static/sponsors/Polar.svg\" width=\"190\" /\u003e\u003c/a\u003e\n\u003c!-- [[[end]]] --\u003e\n\n\u003c/p\u003e\n\n\u003c!-- continue-short --\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cstrong\u003ePlease consider \u003ca href=\"https://github.com/sponsors/hynek\"\u003ejoining them\u003c/a\u003e to help make \u003cem\u003estructlog\u003c/em\u003e’s maintenance more sustainable!\u003c/strong\u003e\n\u003c/p\u003e\n\n## Introduction\n\n*structlog* has been successfully used in production at every scale since **2013**, while embracing cutting-edge technologies like *asyncio*, context variables, or type hints as they emerged.\nIts paradigms proved influential enough to [help design](https://twitter.com/sirupsen/status/638330548361019392) structured logging [packages across ecosystems](https://github.com/sirupsen/logrus).\n\n\u003c!-- end-short --\u003e\n\nA short explanation on *why* structured logging is good for you, and why *structlog* is the right tool for the job can be found in the [Why chapter](https://www.structlog.org/en/stable/why.html) of our documentation.\n\nOnce you feel inspired to try it out, check out our friendly [Getting Started tutorial](https://www.structlog.org/en/stable/getting-started.html).\n\n\u003c!-- begin tutorials --\u003e\nFor a fully-fledged zero-to-hero tutorial, check out [*A Comprehensive Guide to Python Logging with structlog*](https://betterstack.com/community/guides/logging/structlog/).\n\nIf you prefer videos over reading, check out [Markus Holtermann](https://chaos.social/@markush)'s talk *Logging Rethought 2: The Actions of Frank Taylor Jr.*:\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://www.youtube.com/watch?v=Y5eyEgyHLLo\"\u003e\n      \u003cimg width=\"50%\" src=\"https://img.youtube.com/vi/Y5eyEgyHLLo/maxresdefault.jpg\"\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- end tutorials --\u003e\n\n## Credits\n\n*structlog* is written and maintained by [Hynek Schlawack](https://hynek.me/).\nThe idea of bound loggers is inspired by previous work by [Jean-Paul Calderone](https://github.com/exarkun) and [David Reid](https://github.com/dreid).\n\nThe development is kindly supported by my employer [Variomedia AG](https://www.variomedia.de/), *structlog*’s [Tidelift subscribers](https://tidelift.com/?utm_source=lifter\u0026utm_medium=referral\u0026utm_campaign=hynek), and all my amazing [GitHub Sponsors](https://github.com/sponsors/hynek).\n\nThe logs-loving beaver logo has been contributed by [Lynn Root](https://www.roguelynn.com).\n\n\n\u003c!-- begin-meta --\u003e\n\n## Project Links\n\n- [**Get Help**](https://stackoverflow.com/questions/tagged/structlog) (use the *structlog* tag on Stack Overflow)\n- [**PyPI**](https://pypi.org/project/structlog/)\n- [**GitHub**](https://github.com/hynek/structlog)\n- [**Documentation**](https://www.structlog.org/)\n- [**Changelog**](https://github.com/hynek/structlog/tree/main/CHANGELOG.md)\n- [**Third-party Extensions**](https://github.com/hynek/structlog/wiki/Third-party-Extensions)\n\n\n## *structlog* for Enterprise\n\nAvailable as part of the [Tidelift Subscription](https://tidelift.com/?utm_source=lifter\u0026utm_medium=referral\u0026utm_campaign=hynek).\n\nThe maintainers of *structlog* and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications.\nSave time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.\n","funding_links":["https://github.com/sponsors/hynek","https://tidelift.com/funding/github/pypi/structlog","https://tidelift.com/?utm_source=lifter\u0026utm_medium=referral\u0026utm_campaign=hynek","https://polar.sh/"],"categories":["Python","Logging","HarmonyOS","语言资源库","Others"],"sub_categories":["Windows Manager","python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhynek%2Fstructlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhynek%2Fstructlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhynek%2Fstructlog/lists"}