PrairieLog Python Handler
Small logging.Handler for Python services. It batches records through POST /api/v1/kafka/log-events/batch — the Kafka-backed ingestion pipeline that also drives alert aggregation, analysis, and Slack/Discord delivery — maps Python log levels to PrairieLog levels, and flushes on demand.
If the server answers HTTP 503 (Kafka integration disabled or broker unavailable), the handler automatically falls back to the synchronous POST /api/v1/log-events/batch endpoint so logs are never lost — but that endpoint has no alerting side effect, so alerts are degraded until Kafka is back. The fallback is reported once per outage on stderr.
pip install prairielog-handler
For local development from this repository, use pip install ./frontend/sdk/python.
import logging
from prairielog_handler import PrairieLogHandler
handler = PrairieLogHandler(
api_url="https://log-stream-service.onrender.com",
ingestion_token="YOUR_INGESTION_TOKEN",
logger_name="checkout-worker",
)
logging.getLogger().addHandler(handler)
logging.error("Payment failed", extra={"orderId": "ord_123"})
Call handler.flush() before process shutdown when you cannot rely on normal logging cleanup.
Metadata
Release files for prairielog-handler 0.2.0
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 |
|---|---|---|---|---|
| prairielog_handler-0.2.0.tar.gz | 4.0 kB | Without provenance | Details for prairielog_handler-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prairielog_handler-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for prairielog_handler-0.2.0-py3-none-any.whl |
Total release size: 8.3 kB
Release files / prairielog_handler-0.2.0.tar.gz
| Download URL | prairielog_handler-0.2.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa065132f36075a1512f50a055bc816e9a9d9305f36b35123756e4e56a3cd351
|
|
BLAKE2b-256 checksum How to use checksums |
e15d9790e06a6e8b137817130d21bc382df72d57bc3cd7cf204cc8ba7c3b8f2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / prairielog_handler-0.2.0-py3-none-any.whl
| Download URL | prairielog_handler-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d5e5e7298a622e38fbf4a4b62ccfbf2b892e89948332d0915275835480963f0
|
|
BLAKE2b-256 checksum How to use checksums |
e2b150f8564e5ec644ef85f159d3828ece79eac41d737803ebc0db6bb0f62403
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for prairielog-handler 0.2.0
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.