ziplogger (Python)
Python logging handler for ZipLogger — batching,
retries with backoff (429-aware), drop-on-backpressure, and automatic enrichment.
Standard library only — no dependencies.
Install
pip install ziplogger
Usage
import logging
from ziplogger import ZipLoggerHandler
logging.basicConfig(level=logging.INFO)
logging.getLogger().addHandler(ZipLoggerHandler(
endpoint="https://logs.yourcompany.com",
api_key="zk_...",
source="billing-worker", # optional; defaults to the script name
))
log = logging.getLogger("app.orders")
log.info("Order %s created", 83112, extra={"orderId": 83112, "customer": "acme"})
try:
charge()
except Exception:
log.exception("Payment failed") # full traceback → ZipLogger's stackTrace field
extra={...}values become searchable ZipLogger fields; the logger name becomescategory.- Exceptions logged with
log.exception(...)/exc_info=Trueship the full traceback, which feeds ZipLogger's git regression detection. - Enrichment is automatic:
environment,machineName, plusrelease/commitShafrom the constructor orZIPLOGGER_RELEASE/ZIPLOGGER_COMMIT_SHA/GIT_COMMITenv vars.
Behavior
A logging call never blocks and never raises. Entries go into a bounded in-memory queue
(default 10,000); a daemon thread batches them (default 100 per request, 2s linger) and POSTs
NDJSON to /ingest/v1/logs. Transient failures (429 with Retry-After, 5xx, network) retry
with exponential backoff; non-transient responses and exhausted retries drop the batch and
increment handler.dropped. logging.shutdown() (automatic at exit) flushes the buffer.
Options
| Parameter | Default | Purpose |
|---|---|---|
endpoint, api_key |
required | Server base URL + ingestion key |
source, release, commit_sha, environment, tags |
auto | Enrichment overrides |
queue_size |
10000 | Max buffered entries (drops beyond) |
batch_size / flush_interval |
100 / 2.0s | Batching |
max_retries, retry_base_delay, retry_max_delay |
5 / 0.5s / 30s | Retry policy |
timeout |
10.0s | Per-request HTTP timeout |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ziplogger-0.3.3.tar.gz.
File metadata
- Download URL: ziplogger-0.3.3.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5e1677bdd1107d3c1646588c59962682705c42b300dae3e045a66ad6035fd46
|
|
| MD5 |
ea30c8a1e9f19aed7e1e2ad88c4a91a9
|
|
| BLAKE2b-256 |
d756b3d6c81bc22594c7edc7f43b793454a511d255e5d7a8a1b26e40b3058972
|
Provenance
The following attestation bundles were made for ziplogger-0.3.3.tar.gz:
Publisher:
publish.yml on ahaliav/ZipLogger_Client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ziplogger-0.3.3.tar.gz -
Subject digest:
b5e1677bdd1107d3c1646588c59962682705c42b300dae3e045a66ad6035fd46 - Sigstore transparency entry: 2589263787
- Sigstore integration time:
-
Permalink:
ahaliav/ZipLogger_Client@de2b712bfc31b2254e154db269ca70f82c66cec7 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ahaliav
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@de2b712bfc31b2254e154db269ca70f82c66cec7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ziplogger-0.3.3-py3-none-any.whl.
File metadata
- Download URL: ziplogger-0.3.3-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f29fb888b88352e23ab3e2785f62b5b86494d27db161db81f9cf12c45d263d
|
|
| MD5 |
4f4f5060b6d089114e213ac90921a4ae
|
|
| BLAKE2b-256 |
538b6be42d93256e1f0872f57b82a338a603997c4d2eed0b5ce5d695de8a429d
|
Provenance
The following attestation bundles were made for ziplogger-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on ahaliav/ZipLogger_Client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ziplogger-0.3.3-py3-none-any.whl -
Subject digest:
26f29fb888b88352e23ab3e2785f62b5b86494d27db161db81f9cf12c45d263d - Sigstore transparency entry: 2589263876
- Sigstore integration time:
-
Permalink:
ahaliav/ZipLogger_Client@de2b712bfc31b2254e154db269ca70f82c66cec7 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ahaliav
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@de2b712bfc31b2254e154db269ca70f82c66cec7 -
Trigger Event:
push
-
Statement type: