python-json-logger
JSON Log Formatter for the Python Logging Package
Decision gist · record as of 2026-08-14
Yes. This is a lightweight, mature, actively maintained library with zero dependencies and permissive licensing. It solves a concrete problem—making Python logs machine-readable—with minimal friction. Install it if you need JSON-formatted logs for aggregation or centralized monitoring.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low install friction with no runtime dependencies.
- Actively maintained with recent releases; last commit 2026-08-09 and latest release 2026-03-29.
License · maintenance · safety
BSD-2-Clause (permissive) — BSD-2-Clause is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.
last release 2026-03-29 (138 days) · last repo commit 2026-08-09 · 267 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 122,072,365 downloads/mo, #301 on PyPI
Alternatives
Verify before relying
import logging
from python_json_logger import jsonlogger
logger = logging.getLogger()
logHandler = logging.StreamHandler()
formatter = jsonlogger.JsonFormatter()
logHandler.setFormatter(formatter)
logger.addHandler(logHandler)
logger.info('message')- Whether the package integrates with specific log aggregation platforms like ELK or Splunk
- Whether the package supports custom JSON field mapping or filtering
What it is and what it does
Python JSON Logger is a formatter for Python's standard logging module that converts log records into JSON format. Instead of plain-text log lines, it outputs structured JSON objects that can be parsed and indexed by log aggregation platforms. This makes logs machine-readable and enables easier filtering, searching, and analysis in production environments.
The package integrates directly with Python's built-in logging system as a handler formatter. It has no external runtime dependencies, making it lightweight to add to existing projects. The library is mature, actively maintained, and typed for use with static analysis tools.
Use it for
- Convert application logs to JSON format for ingestion into log aggregation systems.
- Standardize log output across microservices for centralized monitoring.
- Enable structured querying and filtering of logs in production environments.
- Integrate Python logging with services that expect JSON-formatted input.
- Improve log searchability by embedding context as JSON fields.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a lightweight, mature, actively maintained library with zero dependencies and permissive licensing. It solves a concrete problem—making Python logs machine-readable—with minimal friction. Install it if you need JSON-formatted logs for aggregation or centralized monitoring.
Install
python-json-logger on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent releases; last commit 2026-08-09 and latest release 2026-03-29. Supports current Python versions (3.10–3.14).
Requires Python 3.10 or later.
License in practice
BSD-2-Clause is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
import logging
from python_json_logger import jsonlogger
logger = logging.getLogger()
logHandler = logging.StreamHandler()
formatter = jsonlogger.JsonFormatter()
logHandler.setFormatter(formatter)
logger.addHandler(logHandler)
logger.info('message')
Verify before relying
- Whether the package integrates with specific log aggregation platforms like ELK or Splunk
- Whether the package supports custom JSON field mapping or filtering
Package facts
| License | BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 138 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,072,365 / month, #301 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: System :: LoggingTyping :: Typed |
Evidence: python_json_logger-4.1.0-py3-none-any.whl
Tags
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 › “json logging python”
- python-json-loggerFormats Python logging output as JSON, making logs machine-readable…
- logging-jsonFormats Python logging records as JSON output, enabling structured…
- logstash_formatterFormats Python logging output as JSON objects compatible with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Logging packages
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.
structlog is a structured logging library that lets you emit logs as dictionaries with flexible output formats (JSON, logfmt, console) and integrates with Python's standard logging or runs standalone.
Install it if your application needs JSON or logfmt output, or if you want to add rich context to logs without string formatting.
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.
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.
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…
progressbar2 renders text-based progress bars in the terminal, handling custom widgets, concurrent bars, unknown-length progress, and clean output around logs and prints.
See also JSON-log-formatter · logfmter · logzero · logging-json · loki-logger-handler · jsonformatter · mo-logs · flake8-json · tinybird-python-sdk · django-log-formatter-asim