--- id: json-logging version: "1.5.1" license: Apache License 2.0 license_treatment: permissive maintenance: active --- # json-logging — JSON Python Logging License: permissive · Maintenance: active · Downloads: 962.2K/mo ## What it is and what it does json-logging wraps Python's standard logging module to emit structured JSON output instead of plain text, making logs automatically indexable and searchable by centralized logging infrastructure. It integrates directly with web frameworks (FastAPI, Flask, Sanic, Quart, Connexion) to automatically instrument HTTP requests, extract correlation IDs for distributed tracing, and attach request context to log entries. For non-web applications, it provides basic JSON logging without correlation tracking. The library is designed for minimal setup—a single initialization call enables JSON output across all loggers—and supports injecting arbitrary extra properties into log records. It has been used in production since 2017 with more than 8 millions downloads, though the current maintainer is seeking someone to take over active development. Use it for: - Enable ELK or EFK stack ingestion by converting Python app logs to JSON format for Elasticsearch indexing - Instrument FastAPI or Flask web services to automatically log HTTP requests with correlation IDs for distributed tracing - Attach request context and correlation IDs to downstream service calls for end-to-end request tracking - Centralize logs from multiple Python services to AWS Cloudwatch or GCP Stackdriver with structured fields - Add custom properties to log records for richer log analysis via extra parameter ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Configures Python's standard logging module to emit structured JSON logs compatible with centralized logging platforms like ELK, EFK, AWS Cloudwatch, and GCP Stackdriver. Yes, with conditions. The package is production-ready, has no dependencies, and solves a real problem for teams using centralized logging. However, the maintainer is actively seeking new owners due to work commitments. If your team can tolerate potential delays in future maintenance or is willing to fork, it is a solid choice; otherwise, verify the transition status before committing to a new project. ## Install pip install json-logging uv add json-logging poetry add json-logging ## Installing json-logging Before you install: Low friction: pure Python with no runtime dependencies, distributed as a wheel. Actively maintained with last commit on 2026-06-17 and 310 repository stars. Maintainer is seeking new maintainers due to work commitments. License in practice: Apache License 2.0 (permissive): you may use, modify, and distribute this package freely in commercial and open-source projects, provided you include a copy of the license and state significant changes. Quickstart: pip install json-logging import json_logging, logging, sys json_logging.init_non_web(enable_json=True) logger = logging.getLogger("test-logger") logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler(sys.stdout)) logger.info("test logging statement") Verify before relying: - Whether the maintainer transition affects ongoing support or release cadence - Specific Python version compatibility (requires_python is unspecified in metadata) ## Package facts - License: Apache License 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 962.2K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags json logging python, structured logging elasticsearch, elk stack python logging, json formatter logging, distributed tracing correlation id, web framework request logging, cloudwatch json logs, structured-logging, distributed-tracing, elk-stack [View on SkillFed](https://skillfed.io/packages/json-logging) · [View on PyPI](https://pypi.org/project/json-logging/)