Skip to main content

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 becomes category.
  • Exceptions logged with log.exception(...) / exc_info=True ship the full traceback, which feeds ZipLogger's git regression detection.
  • Enrichment is automatic: environment, machineName, plus release/commitSha from the constructor or ZIPLOGGER_RELEASE / ZIPLOGGER_COMMIT_SHA / GIT_COMMIT env 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

ziplogger-0.3.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ziplogger-0.3.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for ziplogger-0.3.3.tar.gz
Algorithm Hash digest
SHA256 b5e1677bdd1107d3c1646588c59962682705c42b300dae3e045a66ad6035fd46
MD5 ea30c8a1e9f19aed7e1e2ad88c4a91a9
BLAKE2b-256 d756b3d6c81bc22594c7edc7f43b793454a511d255e5d7a8a1b26e40b3058972

See more details on using hashes here.

Provenance

The following attestation bundles were made for ziplogger-0.3.3.tar.gz:

Publisher: publish.yml on ahaliav/ZipLogger_Client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ziplogger-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 26f29fb888b88352e23ab3e2785f62b5b86494d27db161db81f9cf12c45d263d
MD5 4f4f5060b6d089114e213ac90921a4ae
BLAKE2b-256 538b6be42d93256e1f0872f57b82a338a603997c4d2eed0b5ce5d695de8a429d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ziplogger-0.3.3-py3-none-any.whl:

Publisher: publish.yml on ahaliav/ZipLogger_Client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 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