Structured Logging Utilities for ECL microservices
Internal package for consistent structured logging across ECL microservices. Features JSON formatting, automatic metadata capture, and environment-based configuration. Utility will also handle pushing logs to OpenSearch if the OpenSearch related environment variables are set.
Features
- 📝 Structured JSON logs with consistent schema
- 🕒 Automatic timestamping in ISO 8601 format
- 📍 Complete source location (file path, line number, module, function)
- 🔍 Query-ready fields (transaction_id, request_ip, service_name)
- ⚙️ Environment-controlled log levels
- 🔗 Request context propagation across services
- ☁️ Push logs to OpenSearch enterprise-grade search and observability suite that brings order to unstructured data at scale.
- 👖 Push error and critical logs to Slack
- 🛡 Private package for internal use of ECL
Environment Variables
- ECL_LOGGING_UTILITY_LOG_LEVEL: Set the log level, default: INFO
- ECL_LOGGING_UTILITY_LOG_FORMAT: Stdout render format, compact (single-line JSON, one record per line, so CloudWatch Logs Insights can query its fields) or beautified (multi-line indented JSON). Does not affect OpenSearch shipping. Default: compact
- ECL_LOGGING_UTILITY_APP_VERSION: Denotes the app version which will be displayed in the log, default: AMBIVALENT_APP_VERSION
- ECL_LOGGING_UTILITY_SERVICE_NAME: Denotes the service name which will be displayed in the log, default: AMBIVALENT_SERVICE_NAME
- ECL_LOGGING_UTILITY_OPENSEARCH_ENABLED: Flag to enable/disable pushing logs to OpenSearch endpoint, default: False
- ECL_LOGGING_UTILITY_OPENSEARCH_HOST: OpenSearch endpoint's host, default: localhost
- ECL_LOGGING_UTILITY_OPENSEARCH_PORT: OpenSearch endpoint's port, default: 9200
- ECL_LOGGING_UTILITY_OPENSEARCH_USERNAME: Basic Auth username, default: None
- ECL_LOGGING_UTILITY_OPENSEARCH_PASSWORD: Basic Auth password, default: None
- ECL_LOGGING_UTILITY_SLACK_WEBHOOK_URL: Webhook URL of Slack channel to push notification in case of
error&criticallogs - ECL_LOGGING_UTILITY_INDEX_PATTERN_UUID: UUID of the OpenSearch index pattern with which the log is discovered. It is used to generate the OpenSearch dashboard link.
Installation
pip install ecl-logging-utility
Usage
from ecl_logging_utility import logger
logger.info("You have hit heartbeat", custom_1="1234", custom_2=500.0)
Version History
See CHANGELOG.md for release notes.
Metadata
Release files for ecl-logging-utility 1.0.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ecl_logging_utility-1.0.21.tar.gz | 10.3 kB | Without provenance | Details for ecl_logging_utility-1.0.21.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ecl_logging_utility-1.0.21-py3-none-any.whl | Python 3 | none | any | Details for ecl_logging_utility-1.0.21-py3-none-any.whl |
Total release size: 19.9 kB
Release files / ecl_logging_utility-1.0.21.tar.gz
| Download URL | ecl_logging_utility-1.0.21.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30778ac10ef85afa994690588d4ae7d24c797b4eb3835b31edb58b6f26943897
|
|
BLAKE2b-256 checksum How to use checksums |
64619b2fdb66406d9df18c7dc99f6306a7064102a308afdef482b15292567124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / ecl_logging_utility-1.0.21-py3-none-any.whl
| Download URL | ecl_logging_utility-1.0.21-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c8f7fce7643701de004e4794abde4fd5db83c9a7c876a0656f27162ce8bdbef
|
|
BLAKE2b-256 checksum How to use checksums |
fc384832c07c36f958ce587b0754949d238bc925f77efcee1249617fb4896aa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for ecl-logging-utility 1.0.21
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.