Install & Compatibility
Where this runs
tested against v2.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.408s · 21.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.1s · import 0.374s · 22MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CoralogixLogger
✓ from coralogix.handlers import CoralogixLogger
✗ from coralogix.coralogix_logger import CoralogixLogger
Importing from `coralogix.coralogix_logger` is deprecated and will be removed in future versions. Use `coralogix.handlers` instead.
This quickstart demonstrates how to initialize the Coralogix logger and send basic log messages. It configures a standard Python logger with the Coralogix handler, setting the necessary API key, application name, subsystem, and region. Environment variables are used for sensitive credentials. Logs are explicitly flushed to ensure delivery.
import logging
import os
import json
from coralogix.handlers import CoralogixLogger
PRIVATE_KEY = os.environ.get('CORALOGIX_PRIVATE_KEY', 'YOUR_PRIVATE_KEY')
APP_NAME = os.environ.get('CORALOGIX_APP_NAME', 'my-python-app')
SUB_SYSTEM = os.environ.get('CORALOGIX_SUB_SYSTEM', 'my-subsystem')
REGION = os.environ.get('CORALOGIX_REGION', 'EU1') # e.g., 'EU1', 'US1', 'AP1'
# Get an instance of Python standard logger.
logger = logging.getLogger("Python Logger")
logger.setLevel(logging.DEBUG)
# Get a new instance of Coralogix logger.
# Region is required as of SDK version 2.1.0
coralogix_handler = CoralogixLogger(PRIVATE_KEY, APP_NAME, SUB_SYSTEM, region=REGION)
# Add coralogix logger as a handler to the standard Python logger.
logger.addHandler(coralogix_handler)
# Send messages
logger.info("Hello World from Coralogix Python SDK!")
my_dict = {"host": "localhost", "message": "This is a structured log."}
logger.info(json.dumps(my_dict))
# Manually flush logger to ensure logs are sent before application exit
CoralogixLogger.flush_messages()
print("Logs sent to Coralogix.")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'coralogix.handlers'
The `coralogix-logger` package or its specific `handlers` submodule is not installed, or there is a typo in the import statement.
fixEnsure the library is installed (`pip install coralogix-logger`) and use the correct import statement: `from coralogix.handlers import CoralogixLogger`.
ValueError: private_key cannot be empty
The `private_key` parameter was provided as an empty string or was omitted during the initialization of the `CoralogixLogger` handler, which is a mandatory configuration for sending logs.
fixProvide a valid, non-empty Coralogix private key as a string when initializing the `CoralogixLogger`.
ValueError: application_name and subsystem_name must be non-empty strings
The `application_name` or `subsystem_name` parameters were provided as empty strings or omitted during the initialization of the `CoralogixLogger`, which are mandatory for log classification.
fixEnsure that `application_name` and `subsystem_name` are set to descriptive, non-empty strings during the `CoralogixLogger` initialization.
ValueError: region must be specified for CoralogixLogger (SDK version >= 2.1.0)
The `region` parameter was not provided during the initialization of the `CoralogixLogger` handler, which is mandatory for SDK versions 2.1.0 and above.
fixPass your correct Coralogix region (e.g., `region=coralogix.Region.EUROPE1`) to the `CoralogixLogger` constructor.
Upgrade
Version history
2.1.1latest on PyPI · released Dec 10, 2025
Audit
Dependencies
No dependency data recorded yet.