$npx skillfedfor your agent

structlog

Structured Logging for Python

Worth itPyPI LoggingReleased Jun 2026113.6M downloads / moMIT OR Apache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — structlog-26.1.0-py3-none-any.whl
v26.1.0 · released 2026-06-06 · Python >=3.10 · 1 runtime deps: typing-extensions

Yes. structlog is a mature, actively maintained library with no security issues, minimal dependencies, and permissive licensing. It's well-suited for production use if you want structured, queryable logs and are willing to adopt its dictionary-based paradigm. Install it if your application needs JSON or logfmt output, or if you want to add rich context to logs without string formatting.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later; Python 3.8 and 3.9 support have been removed in version 26.1.0.
  • Low install friction with a single runtime dependency (typing-extensions).
  • Active maintenance since 2013 with a recent release 69 days ago; actively developed with 4914 GitHub stars.

License · maintenance · safety

MIT OR Apache-2.0 (permissive) — Dual-licensed under MIT or Apache-2.0 (permissive), so you can choose either license for your use case with no restrictions on commercial or proprietary applications.

last release 2026-06-06 (69 days) · last repo commit 2026-08-06 · 4,914 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 113,620,670 downloads/mo, #314 on PyPI

Verify before relying

pip install structlog

import structlog
log = structlog.get_logger()
log.info("event", user_id="user", session="session")
  • Whether the standard library logging integration requires additional setup beyond the basic import.
  • Performance characteristics compared to the standard library logging module in high-throughput scenarios.
  • Whether all output formatters (JSON, logfmt, console) are equally mature or if some are newer/less tested.
Same gist for agents: .md · .json

What it is and what it does

structlog is a structured logging library that treats logs as dictionaries rather than formatted strings, letting you emit rich, queryable log events. It has been used in production since 2013 and supports modern Python features like asyncio, context variables, and type hints. You can choose to let structlog handle output directly or forward events to the standard library's logging module, giving you flexibility in how logs are processed and where they go.

The library comes with built-in formatters for JSON, logfmt, and pretty console output, and its processor-based architecture means you can add custom logic (like adding callsite information, thread names, or qualified module names) without modifying your logging calls. It has a single runtime dependency on typing-extensions and is actively maintained with no known security vulnerabilities.

Use it for

  • Emit JSON logs in containerized applications for aggregation into centralized logging systems.
  • Add structured context to all logs within an async request handler using bound loggers.
  • Replace standard library logging with structlog while keeping the same logger interface via stdlib integration.
  • Debug production issues by querying queryable log fields instead of parsing unstructured text.
  • Log exceptions with rich formatting and optional monochrome output for terminals without color support.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

structlog is a mature, actively maintained library with no security issues, minimal dependencies, and permissive licensing. It's well-suited for production use if you want structured, queryable logs and are willing to adopt its dictionary-based paradigm. Install it if your application needs JSON or logfmt output, or if you want to add rich context to logs without string formatting.

Install

structlog on PyPI

Before you install

Low install friction with a single runtime dependency (typing-extensions). Active maintenance since 2013 with a recent release 69 days ago; actively developed with 4914 GitHub stars.

Requires Python 3.10 or later; Python 3.8 and 3.9 support have been removed in version 26.1.0.

License in practice

Dual-licensed under MIT or Apache-2.0 (permissive), so you can choose either license for your use case with no restrictions on commercial or proprietary applications.

Quickstart

pip install structlog

import structlog
log = structlog.get_logger()
log.info("event", user_id="user", session="session")

Verify before relying

  • Whether the standard library logging integration requires additional setup beyond the basic import.
  • Performance characteristics compared to the standard library logging module in high-throughput scenarios.
  • Whether all output formatters (JSON, logfmt, console) are equally mature or if some are newer/less tested.

Package facts

LicenseMIT OR Apache-2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
typing-extensions
MaintenanceActively maintained 69 days since the last release
Last repo commit
First released
Downloads113,620,670 / month, #314 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: System :: LoggingTyping :: Typed

Evidence: structlog-26.1.0-py3-none-any.whl

Tags

Capabilities
structured logging pythonjson loggingbound loggerasync logginglogfmt outputproduction loggingcontext variables logging
Topics
structured-loggingjson-outputasync-ready
PyPI keywords
logloggingstructurestructured

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “bound logger”

  • structlogstructlog is a structured logging library that lets you emit logs as…
  • weakrefmethodProvides a WeakMethod class for storing bound methods using weak…
  • logging-treeVisualizes the hierarchy of loggers, handlers, and filters in…

Give your agent the search over MCP, or paste the wish link into any chat.

More Logging packages

tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
python-json-logger Worth it
PyPI · Logging · released Mar 2026

Formats Python logging output as JSON, making logs machine-readable for parsing and ingestion into log aggregation tools.

Install it if you need JSON-formatted logs for aggregation or centralized monitoring.

BSD-2-Clausepure Python · 3.10+
122.1Mdownloads / mo
loguru Worth it
PyPI · Logging · released Dec 2024

Loguru provides a pre-configured logger that replaces Python's standard logging with a simpler, zero-boilerplate interface for writing log messages to stderr, files, or custom handlers.

Install it if you want logging to feel natural but with the power, structure that production code needs.

MITpure Python
81.9Mdownloads / mo
coloredlogs With conditions
PyPI · Software Development · released Jun 2021

Adds colored output to Python's standard logging module using ANSI escape sequences, with automatic fallback support for Windows terminals.

However, it is abandoned and receives no maintenance, so it will not adapt to future Python changes or platform updates.

MITpure Pythonabandoned
39.6Mdownloads / mo
wandb Worth it
PyPI · Python Modules · released Aug 2026

wandb is a machine learning experiment tracking and visualization platform that logs metrics, hyperparameters, datasets, and models to a centralized dashboard for monitoring and comparing training runs.

Install it if you need centralized experiment tracking, comparison, and visualization for machine learning projects; skip it if you prefer local-only logging or have…

MITcompiled wheel · 3.10+
26.4Mdownloads / mo
progressbar2 Worth it
PyPI · Libraries · released Aug 2026

progressbar2 renders text-based progress bars in the terminal, handling custom widgets, concurrent bars, unknown-length progress, and clean output around logs and prints.

BSD-3-Clausepure Python · 3.10+
19.3Mdownloads / mo

See also django-structlog · macwinnie-enhanced-logging · structlog-sentry · logfmter · structlog-pretty · pytest-structlog · opentelemetry-instrumentation-structlog · Twiggy · structlog-gcp · Logbook