jsonformatter
Python log in json format.
What it is and what it does
jsonformatter is a Python logging formatter that converts log records into JSON output, making logs machine-readable and suitable for centralized log aggregation platforms. It works by intercepting Python's standard logging system and reformatting each LogRecord as JSON, allowing you to customize which record attributes appear in the output and in what order.
The package supports multiple configuration approaches: a simple basicConfig function for quick setup, direct JsonFormatter instantiation for fine-grained control, and logging config files for declarative configuration. It also allows you to inject custom attributes into LogRecords—useful in web frameworks like Flask or Django where you might want to automatically include request context (username, URL, session data) in every log line. The formatter supports all json.dumps parameters and handles non-JSON-serializable custom attributes.
Use it for:
- Centralize logs from a Python application into LogStash or similar aggregation systems by formatting each log entry as JSON.
- Add request-scoped context (user ID, request URL, session data) to logs in Flask or Django applications automatically.
- Parse and query logs programmatically by ensuring all output is valid JSON rather than unstructured text.
- Migrate from text-based logging to structured logging without rewriting application log statements.
- Output multiple LogRecord attributes in custom JSON keys for downstream analytics or monitoring tools.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Formats Python logging output as JSON, enabling structured logs suitable for log aggregation systems like LogStash.
Yes, with conditions. Install if you need JSON-formatted logs for aggregation or structured logging in a Python application and are comfortable with source-only distribution and dormant maintenance. The package is stable and has no known vulnerabilities, but the lack of wheels and infrequent updates mean you should verify compatibility with your target Python version before production deployment. Not recommended for projects requiring active upstream support.
Install
jsonformatter on PyPI
pip
pip install jsonformatteruv
uv add jsonformatterpoetry
poetry add jsonformatterInstalling jsonformatter
Before you install
High install friction: the package is distributed only as source (tar.gz), with no wheels available. Maintenance is dormant—last release was 631 days ago, though the repository remains active with a recent commit on 2024-11-21. No runtime dependencies, so installation itself is straightforward once the source builds.
License in practice
BSD 2-Clause License (permissive): you may use, modify, and distribute the package freely in both open-source and commercial projects, provided you retain the license notice and disclaimer.
Quickstart
import logging
from jsonformatter import basicConfig
basicConfig(level=logging.INFO)
logging.info('hello, jsonformatter')
# Output: {"levelname": "INFO", "name": "root", "message": "hello, jsonformatter"}
Verify before relying
- Whether the source-only distribution (no wheels) and dormant maintenance pose practical barriers for production use.
- Current compatibility with modern Python versions beyond the stated 2.7 and 3.x support.
- Performance characteristics when handling high-volume logging in production systems.
Package facts
| License | BSD 2-Clause License Copyright (c) 2019, MyColorfulDays All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=2.7) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 631 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 406,679/month — #6,894 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonformatter-0.3.4.tar.gz
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
logfmterFormats Python stdlib logging output as logfmt…
permissive · top 15,000 on PyPI
logging-jsonFormats Python logging records as JSON output,…
permissive · top 15,000 on PyPI
logstash_formatterFormats Python logging output as JSON objects…
permissive · top 15,000 on PyPI
logzerologzero provides pre-configured Python logging…
permissive · top 5,000 on PyPI
JSON-log-formatterFormats Python logging records as JSON,…
permissive · top 5,000 on PyPI
lib-log-richProvides Rich-styled colored console logging…
permissive · top 15,000 on PyPI
logdnaIntegrates Python's standard logging framework…
permissive · top 15,000 on PyPI
python-json-loggerFormats Python logging output as JSON, making…
permissive · top 1,000 on PyPI
python3-logstashA Python logging handler that forwards log…
permissive · top 15,000 on PyPI
logging-formatter-anticrlfA drop-in replacement for Python's standard…
permissive · top 15,000 on PyPI