Skip to main content

Structured Logging Utilities for ECL microservices

Python Version License

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_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 & critical logs
  • 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.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecl-logging-utility 1.0.20
File Size Uploaded
ecl_logging_utility-1.0.20.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecl-logging-utility 1.0.20
File Interpreter ABI Platform
ecl_logging_utility-1.0.20-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / ecl_logging_utility-1.0.20.tar.gz

Download URL ecl_logging_utility-1.0.20.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c769605bc7f734bd8714f279559de6244230305e293fa610bf5c06dfb7d16e66
BLAKE2b-256 checksum
How to use checksums
4fc73f3fe5143280dc811ca8b0c03ac26c206dd8324316e10fea948dcee6d659
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.20-py3-none-any.whl

Download URL ecl_logging_utility-1.0.20-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa3d6da7fea09a078ec16372bf0bebe660957b774ccc3a52f22b81fae34585c1
BLAKE2b-256 checksum
How to use checksums
fb73d48086b638004068575ad3f02130e63ef4143dd767650092ecba8df0bc90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.20 This release

2 release files

1.0.18

2 release files

1.0.17

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page