--- id: jsonformatter version: "0.3.4" 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) license_treatment: permissive maintenance: dormant --- # jsonformatter — Python log in json format. License: permissive · Maintenance: dormant · Downloads: 406.7K/mo ## 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 above — 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 pip install jsonformatter uv add jsonformatter poetry add jsonformatter ## Installing 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_current - Install friction: high - Maintenance: dormant - Downloads: 406.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json logging formatter, python structured logs, logstash compatible logging, json log output, python log json format, structured logging python, log aggregation formatter, logging, json-output, structured-logs [View on SkillFed](https://skillfed.io/packages/jsonformatter) · [View on PyPI](https://pypi.org/project/jsonformatter/)