--- id: ecs-logging version: "2.3.0" license: unclear license_treatment: permissive maintenance: active --- # ecs-logging — Logging formatters for ECS (Elastic Common Schema) in Python License: permissive · Maintenance: active · Downloads: 2.9M/mo ## What it is and what it does ecs-logging is a Python logging formatter that converts log records into Elastic Common Schema (ECS) JSON format. It integrates with Python's standard logging module to output structured logs that Elastic Stack tools can parse and index natively. The library implements ECS 1.6 and supports automatic correlation with Elastic APM traces when used alongside the Elastic APM Python agent, allowing logs to be linked to spans, transactions, and traces in APM dashboards. The package has no runtime dependencies and works with Python 3.8 through 3.14. It is maintained by Elastic and marked production-stable, with active development and recent commits. Installation is straightforward via pip, and integration typically requires only adding the formatter to a logging handler. Use it for: - Correlate application logs with Elastic APM traces to debug performance issues across distributed systems - Stream structured logs to Elasticsearch for centralized log aggregation and analysis - Replace ad-hoc JSON logging with a standardized schema that Elastic tooling understands out of the box - Standardize log format across microservices using a common schema recognized by Elastic Stack ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Formats Python logs as Elastic Common Schema (ECS) JSON, enabling structured log output compatible with Elastic Stack and APM correlation. Yes. Low install friction, no dependencies, active maintenance, and production-stable status make it a straightforward choice if you use Elastic Stack or APM. The permissive Apache-2.0 license poses no restrictions. Install it if you need ECS-formatted logs for Elasticsearch or APM correlation; skip it if you don't use Elastic tooling. ## Install pip install ecs-logging uv add ecs-logging poetry add ecs-logging ## Installing ecs-logging Before you install: Low install friction with no runtime dependencies. Active maintenance, last commit 2026-07-26, supporting current Python versions (3.8–3.14). Production-stable classifier. License in practice: Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions. Quickstart: pip install ecs-logging import logging from ecs_logging import StdlibFormatter logger = logging.getLogger() handler = logging.StreamHandler() handler.setFormatter(StdlibFormatter()) logger.addHandler(handler) logger.info('message') Verify before relying: - Whether ECS 1.6 implementation covers all current ECS specification features needed for your use case - Exact APM agent version compatibility for log correlation with Elastic APM Python agent ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ECS logging formatter, elastic common schema python, structured JSON logging, elastic stack log integration, APM log correlation, elasticsearch logging format, structured logging python, structured-logging, elastic-stack, apm-integration [View on SkillFed](https://skillfed.io/packages/ecs-logging) · [View on PyPI](https://pypi.org/project/ecs-logging/)