Registry / observability / coralogix-logger

coralogix-logger

JSON →
library2.1.1pypypi✓ verified 23d ago

The Coralogix Python SDK enables sending logs directly from Python applications to the Coralogix platform. It leverages Python's standard logging library and operates asynchronously using a dedicated thread for log buffering and flushing. The current version is 2.1.1, and the library is actively maintained with regular updates.

pip install coralogix-logger
INSTALL
IMPORT
SIG · CORALOGIX-LOGGER
C
coralogix-logger
observabilitypythonv2.1.1
Install
2.1s avg
Import
391ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.408s · 21.3MB
glibc
py 3.103.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.")
Debug
Known issues
breakingAs of SDK version 2.1.0, it is required to specify your Coralogix region during initialization. Failing to do so will result in logs not being sent to the correct regional endpoint.
fix
Initialize `CoralogixLogger` with the `region` parameter (e.g., `region="EU1"`) or set the `CORALOGIX_REGION` environment variable.
affects: >=2.1.0
deprecatedImporting `CoralogixLogger` directly from `coralogix.coralogix_logger` is deprecated and will be removed in future versions.
fix
Update your imports to `from coralogix.handlers import CoralogixLogger`.
affects: >=2.0.0
gotchaWhen using uWSGI, threading support must be explicitly enabled, as the Coralogix logger relies on a background thread for sending logs.
fix
Add `enable-threads = true` to your `wsgi.ini` file or ensure threading is enabled in your uWSGI configuration.
affects: All
gotchaLogs might not be sent immediately upon calling logging methods due to the asynchronous nature of the SDK. For scripts or applications that exit quickly, ensure logs are flushed manually.
fix
Call `CoralogixLogger.flush_messages()` before your application exits to ensure all buffered logs are sent.
affects: All
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.
fix
Ensure 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.
fix
Provide 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.
fix
Ensure 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.
fix
Pass 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.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
coralogix-logger — pip install coralogix-logger · libregistry