What problem does it solve?
This Skill helps you design high-signal, production-grade structured logging pipelines in Go by composing sampling, PII-safe formatting, routing, and HTTP/server context so logs stay accurate and cost-efficient.
Core Features & Use Cases
- Structured pipeline composition: Use samber/slog-multi patterns (Router, Fanout, Pool, Failover, Pipe) to send each record to the right sink(s).
- Noise control with sampling: Apply slog-sampling so high-volume Debug/Info logs are throttled while preserving visibility for important events.
- PII and attribute transformation: Use slog-formatter middlewares (PIIFormatter, IPAddressFormatter, ErrorFormatter, and more) to sanitize and normalize log attributes before export.
- HTTP request logging integration: Use samber/slog-gin, slog-echo, slog-fiber, slog-chi, or slog-http to attach request-scoped fields for downstream handlers.
- Backend sink routing: Route records to sinks like Sentry, Loki, Datadog, Kafka, Slack, and others using standard slog.Handler interfaces and consistent constructors.
Quick Start
Use golang-samber-slog-**** to set up a Go slog pipeline where sampling is applied first, PII scrubbing is applied next, and a Router sends errors to Sentry while the rest go to Loki.