# hynek/structlog

Simple, powerful, and fast logging for Python.

Repository: https://github.com/hynek/structlog
Canonical: https://ross.abutalabs.com/products/structlog
Homepage: https://www.structlog.org/
Language: Python
License: NOASSERTION
License Family: other
Topics: python, logging, structured-logging
Last push: 2026-08-06T13:02:34+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 75, longevity 100
- inputs: {"age_days": 4768, "days_push": 27, "days_rel": 88, "gap_med": 54, "n_releases_24m": 6}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4927, forks 294 (observed 2026-08-28T04:09:02.568781+00:00)

## What it is
structlog is a production-ready structured logging library for Python that treats log entries as dictionaries processed through composable functions. It supports JSON, logfmt, and pretty console output, and can integrate with or replace the standard library's logging module.

## Use cases
- add structured logging to a python application
- output logs as  for log aggregation
- make python logs machine-parseable
- pretty colored console logs during development
- integrate structured logs with stdlib logging
- correlate log entries with key-value context

## When to choose
- you want key-value structured logs in python with minimal effort
- you need fast, flexible log formatting including  or logfmt
- you want to gradually adopt structured logging alongside existing logging setups

## When to avoid
- you only need trivial print-style debugging
- your platform is not python
- you are locked into a logging framework structlog cannot integrate with

## Facets
- artifact type: library
- maturity: stable
- function: logging, serialization
- domain: developer-tools, backend, monitoring
- platform: python, cross-platform
- tags: structured-logging, -logging, logfmt, observability

## Member repositories
- hynek/structlog (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:02.568781+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:17:59.280827+00:00, confidence not recorded.
  - readme: https://github.com/hynek/structlog (fetched 2026-08-28T04:09:02.568781+00:00, sha 0e63e86a17f9)
  - registry_pypi: https://pypi.org/pypi/structlog/json (fetched 2026-08-29T09:00:11.091921+00:00, sha b8318667894f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
