---
id: structlog
version: "26.1.0"
license: MIT OR Apache-2.0
license_treatment: permissive
maintenance: active
---
# structlog — Structured Logging for Python
License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI
## Install
pip install structlog
uv add structlog
poetry add structlog
## Description
*structlog* is *the* production-ready logging solution for Python:
- **Simple**: Everything is about **functions** that take and return **dictionaries** – all hidden behind **familiar APIs**.
- **Powerful**: Functions and dictionaries aren’t just simple but also powerful.
*structlog* leaves *you* in control.
- **Fast**: *structlog* is not hamstrung by designs of yore.
Its flexibility comes not at the price of performance.
Thanks 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.
The 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:
[ · [View on PyPI](https://pypi.org/project/structlog/)