Python Cheatsheet 08 — Logging with structlog
Cheatsheet: structlog setup, JSON/console, contextvars, processors, trace correlation.
Cheatsheet: structlog setup, JSON/console, contextvars, processors, trace correlation.
Cheatsheet: logging drivers, rotation, structured logs, forwarders.
Cheatsheet: basicConfig, named loggers, handlers, formatters, dictConfig.
Cheatsheet: Django LOGGING, structured logs, request middleware, Sentry, metrics.
Practical Python logging: structlog over stdlib, JSON for parseability, correlation IDs via contextvars, levels that mean something, and PII redaction.
Picking a log aggregator in 2026: Loki for cheap storage, ClickHouse for query power, OpenSearch for full-text, Datadog when you can pay. Decision matrix and patterns.