Skip to main content

Python binding for dagstack/logger-spec — OTel-compatible structured logging with a named-logger hierarchy, context propagation, pluggable sinks, and scoped overrides

Project description

dagstack-logger

Python binding for dagstack/logger-spec — OTel-compatible structured logging with a named-logger hierarchy, W3C trace context propagation, pluggable sinks, and scoped overrides.

Typically configured from a dagstack-config logging: section, but dagstack-config is not a runtime dependency — see Dependencies below.

Status: Phase 1 MVP. Console / File / In-memory sinks ship; OTLP, redaction processor chain, and the AI-agent extension pack land in Phase 2+.

Roadmap

  • Phase 1 release (0.x series) — current. LogRecord / Severity / W3C hex encoding / dagstack JSON-lines wire format; ConsoleSink (JSON/pretty TTY-aware), FileSink (rotation), InMemorySink (ring buffer); Logger hierarchy with context propagation, suffix-based redaction (RedactionConfig), and scoped overrides. The module-level configure(...) accepts a section dumped from dagstack-config; no hard runtime dependency on the config binding. No OTLP sink, no LogProcessor chain, no AI-agent extension pack (§5.5 of logger-spec) yet.
  • Phase 2+OTLPSink, LokiSink, SentrySink, the LogProcessor chain (redaction / sampling), AI-agent conventions.

Spec

The spec lives as a submodule in spec/dagstack/logger-spec. The core decisions are in spec/adr/0001-logger-contract.md.

Local development

git clone --recurse-submodules https://github.com/dagstack/logger-python.git
cd logger-python
uv sync --group dev

make test           # pytest
make lint           # ruff check + format --check
make typecheck      # mypy --strict

Dependencies

  • opentelemetry-api>=1.20,<2.0 — for trace / span / baggage context propagation (mandatory per spec §3.4).
  • opentelemetry-sdk + exporter (optional via [otlp] extras) — for OTLPSink in Phase 2+.

dagstack-logger does not declare a runtime dependency on dagstack-config: the application loads its config via the config binding and passes the resolved logging: section to configure(**section) (see dagstack/config-python).

Licensing

Apache-2.0.

Related

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagstack_logger-0.2.0.tar.gz (147.3 kB view details)

Uploaded Source

Built Distribution

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

dagstack_logger-0.2.0-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file dagstack_logger-0.2.0.tar.gz.

File metadata

  • Download URL: dagstack_logger-0.2.0.tar.gz
  • Upload date:
  • Size: 147.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for dagstack_logger-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d45e486f2461c213bfdbd0041ad4b0d1b2d43d424ad3b3e638b1acca8892a728
MD5 79e51e59a74d55a7278352ec79f3b95a
BLAKE2b-256 4050cab7b583915119a538e3d54cb493c214b046f27b7c3e4f62a60445d07d49

See more details on using hashes here.

File details

Details for the file dagstack_logger-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dagstack_logger-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58ef543eeae55cfc410cedf5db3c1a5968fd316820a5e91be0ec380fbec3a5a3
MD5 44b759fe93225ecfed187f755967cff9
BLAKE2b-256 09901ebd54494ebbaff4523008249f3826a39eaf95b8f5f5ed251ca78ed3f6c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page