What problem does it solve?
Go projects often struggle with high-volume, structured logging that is easy to route, filter, and back-end efficiently. This skill shows how to compose pipelines using samber/slog libraries to achieve deterministic performance and clear log structures.
Core Features & Use Cases
- 20+ composable slog.Handler packages for Go 1.21+ that enable pipeline construction, routing, and sinks.
- Deterministic pipeline ordering (sampling outermost, then formatting, then routing) to minimize wasted CPU and ensure sinks see clean data.
- HTTP middlewares and backends integration with versioned modules (e.g. slog-datadog, slog-loki, slog-sentry) for production-grade deployments.
- Practical guidance for using Router vs Fanout, first-match vs multi-predicate routing, and graceful shutdown for batched sinks.
Quick Start
Configure a pipeline that samples noisy logs, formats attributes to remove sensitive data, and routes errors to Sentry while streaming normal logs to Loki.