Skip to main content

pylogify

PII-safe JSON logging for Python's standard logging module. Every line follows the logify log contract (v1) and carries trace_id / span_id from the active OpenTelemetry span. Emails, card numbers, tokens and other sensitive values are redacted before they are written.

pip install pylogify

The import name is logify:

import logging
from logify import setup_logging

setup_logging()   # once, at startup; routes all loggers (uvicorn, gunicorn, django) to JSON stdout
logging.getLogger(__name__).info("order created", extra={"order_id": "o_1"})
logging.getLogger(__name__).info("user role changed", extra={"log_type": "audit", "actor": {"id": "u_1"}})

For traces and metrics, run the app with opentelemetry-instrument and set OTEL_EXPORTER_OTLP_ENDPOINT. service, env and version default to OTEL_SERVICE_NAME, DEPLOY_ENV and APP_VERSION. The redaction rules are bundled in the package and shared with the Node and Java packages. A field in extra= named like a contract field (level, service, error, ...) is written as extra_<name> so it can't overwrite the contract.

Licensed under Apache-2.0.

Metadata

Release files for pylogify 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylogify 1.0.0
File Size Uploaded Provenance Actions
pylogify-1.0.0.tar.gz 10.1 kB Without provenance Details for pylogify-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylogify 1.0.0
File Interpreter ABI Platform Actions
pylogify-1.0.0-py3-none-any.whl Python 3 none any Details for pylogify-1.0.0-py3-none-any.whl

Total release size: 19.5 kB

Release files / pylogify-1.0.0.tar.gz

Download URL pylogify-1.0.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b1b9cd7657ab67478e45fc0db8aa1aabeb615942782439a8d6b04acfedb6370f
BLAKE2b-256 checksum
How to use checksums
5c817b6f968c9d054f7bc1ced2143dbf2a5e4211329e4280d0553a053c12bb85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pylogify-1.0.0-py3-none-any.whl

Download URL pylogify-1.0.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c996e973c4901aad02fe467ba80bbd848288194ca95c69ec43798eb0622bacf
BLAKE2b-256 checksum
How to use checksums
8848d7580fc9f54f2e3889da0f8404daff9adbd1ace1467492ce2d87f1b66b7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for pylogify 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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