logging-json
JSON formatter for python logging
Decision gist · record as of 2026-08-14
Yes, if you need structured JSON logging for a log aggregation platform. The package is stable, dependency-free, and straightforward to integrate. Dormant maintenance is acceptable for a focused formatter—the core logging API is unlikely to change. No known vulnerabilities. Install if you're already using Splunk, Elasticsearch, or similar systems; skip if you only need plain-text or Python's default formatting.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Dormant maintenance (last commit 2025-02-04, 556 days since release) but marked Production/Stable and supports current Python versions through 3.13.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for any project type.
last release 2025-02-04 (556 days) · last repo commit 2025-02-04 · 18 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 271,433 downloads/mo, #8,222 on PyPI
Alternatives
Verify before relying
import logging
import logging_json
formatter = logging_json.JSONFormatter(fields={
"level_name": "levelname",
"thread_name": "threadName"
})
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger = logging.getLogger()
logger.addHandler(handler)
logger.info({"key": "value"})- Whether the package is actively maintained or if dormant status signals end-of-life intent.
- Performance characteristics when formatting high-volume logging streams.
- Compatibility with async logging frameworks or concurrent logging scenarios.
What it is and what it does
logging-json is a formatter for Python's standard logging module that converts log records into JSON output. It sits between your application's logging calls and the output stream, intercepting records and serializing them as structured JSON dictionaries. This is particularly useful when your logs are consumed by centralized log aggregation systems like Splunk or Elasticsearch, which expect structured data rather than plain text.
The formatter handles three main logging patterns: dictionary logging (where you pass a dict directly), string logging (where you pass a message string), and exception logging (where it captures exception type, message, and stack trace). You can add custom fields to every log entry, customize field names, and control timestamp formatting. It integrates seamlessly with Python's standard logging.config.dictConfig, allowing you to configure it via Python dict or YAML file.
Use it for
- Send application logs to Splunk or Elasticsearch with proper JSON structure for indexing and search.
- Add custom metadata fields (service name, environment, request ID) to every log entry automatically.
- Capture exception details including type, message, and full stack trace in a structured JSON format.
- Replace plain-text logging with structured output for easier parsing and analysis in log aggregation platforms.
- Configure JSON logging via YAML or dictConfig without modifying application code.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need structured JSON logging for a log aggregation platform.
The package is stable, dependency-free, and straightforward to integrate. Dormant maintenance is acceptable for a focused formatter—the core logging API is unlikely to change. No known vulnerabilities. Install if you're already using Splunk, Elasticsearch, or similar systems; skip if you only need plain-text or Python's default formatting.
Install
logging-json on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Dormant maintenance (last commit 2025-02-04, 556 days since release) but marked Production/Stable and supports current Python versions through 3.13.
Requires Python 3.9 or later.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for any project type.
Quickstart
import logging
import logging_json
formatter = logging_json.JSONFormatter(fields={
"level_name": "levelname",
"thread_name": "threadName"
})
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger = logging.getLogger()
logger.addHandler(handler)
logger.info({"key": "value"})
Verify before relying
- Whether the package is actively maintained or if dormant status signals end-of-life intent.
- Performance characteristics when formatting high-volume logging streams.
- Compatibility with async logging frameworks or concurrent logging scenarios.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 556 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 271,433 / month, #8,222 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Build ToolsTyping :: Typed |
Evidence: logging_json-0.6.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 › “splunk log formatting”
- logging-jsonFormats Python logging records as JSON output, enabling structured…
- splunk-handlerA Python logging handler that sends log events to a Splunk Enterprise…
- splunk-hec-handlerIntegrates Python logging with Splunk's HTTP Event Collector (HEC) to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
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.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also jsonformatter · logfmter · logstash_formatter · JSON-log-formatter · logzero · python-json-logger · daiquiri · splunk-handler · mo-logs · jsonobject