golang-samber-slog

Compose multi-handler Go slog pipelines with sampling, PII formatting, and routing.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/Jylhis/claude-marketplace --skill golang-samber-slog-jylhis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-slog
Source: https://github.com/Jylhis/claude-marketplace/tree/main/plugins/golang-dev/skills/golang-samber-slog
Command: npx skills add https://github.com/Jylhis/claude-marketplace --skill golang-samber-slog-jylhis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers need a consistent way to configure structured logging in Go, handling sampling, PII scrubbing, and routing to multiple back‑ends without duplicating boilerplate.

Core Features & Use Cases

  • Multi‑handler composition with slog-multi for Fanout, Router, Failover, and Pool patterns.
  • Sampling strategies via slog-sampling to drop noisy logs before they are formatted.
  • PII & attribute formatting using slog-formatter for email, IP, and custom fields.
  • HTTP middleware integration for Gin, Echo, Fiber, and Chi to inject request IDs and trace information.
  • Backend sinks such as Datadog, Loki, Sentry, Kafka, and others, with proper graceful shutdown.

Quick Start

Ask the AI to configure a Go slog pipeline that samples logs at 10 % and scrubs PII, routing errors to Sentry while sending all logs to Loki.

Frequently Asked Questions about golang-samber-slog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up structured logging in Go with sampling and PII scrubbing?

Structured logging in Go with sampling and PII scrubbing is set up by composing multi-handler pipelines using samber/slog-multi and slog-formatter to drop noisy logs and format email or IP fields before routing to back-ends.

How does slog sampling work to reduce log volume in Go applications?

Slog sampling works by using the slog-sampling library to drop noisy logs before they are formatted, reducing log volume in Go applications by intercepting records early in the multi-handler pipeline.

Can I use slog pipelines with HTTP middleware in Go frameworks like Gin or Echo?

You can use slog pipelines with HTTP middleware in Go frameworks like Gin, Echo, Fiber, and Chi to inject request IDs and trace information into your structured logs.

Do I need Go 1.21 to use samber slog packages for logging pipelines?

You need Go 1.21 or higher to use samber/slog packages for logging pipelines, as the structured logging pipeline relies on the native slog package introduced in that version.

What is the best way to route Go logs to multiple back-ends like Sentry and Loki?

The best way to route Go logs to multiple back-ends like Sentry and Loki is using slog-multi Fanout patterns to send errors to Sentry and all logs to Loki simultaneously within a single pipeline configuration.

How do I integrate OpenTelemetry trace IDs with Go slog pipelines?

You integrate OpenTelemetry trace IDs with Go slog pipelines by using HTTP middleware to inject trace information into log records, ensuring observability context is preserved across distributed systems.