What problem does it solve?
Developers need a unified way to configure structured logging in Go, handling sampling, PII scrubbing, HTTP request tracing, and routing to various backends without writing repetitive boilerplate.
Core Features & Use Cases
- slog-multi composition: combine multiple handlers (Fanout, Router, Failover, Pool) in a single pipeline.
- slog-sampling: apply rate‑limited or threshold sampling to reduce log volume.
- slog-formatter: mask PII such as emails or IP addresses before logs leave the process.
- HTTP middleware: ready‑made gin, echo, fiber, chi, and net/http integrations that inject request attributes.
- Backend routing: send logs to Datadog, Sentry, Loki, Syslog, Logstash, Graylog, and other sinks with graceful shutdown support.
- Use case: a microservice that records request traces, scrubs user data, samples high‑frequency debug logs, and forwards errors to Sentry while streaming all logs to Loki.
Quick Start
Create a logger that samples 10 % of info logs, scrubs email fields, routes errors to Sentry, and writes all records to stdout as JSON.