golang-samber-slog

Compose Go slog pipelines with slog-multi, sampling, and formatter for routing.

Updated Apr 24, 2026
One-click install
npx skills add https://github.com/Utchash007/TermTales --skill golang-samber-slog-utchash007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-slog
Source: https://github.com/Utchash007/TermTales/tree/main/.agents/skills/golang-samber-slog
Command: npx skills add https://github.com/Utchash007/TermTales --skill golang-samber-slog-utchash007

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go applications often struggle to orchestrate structured logs across multiple sinks, with noisy noise and inconsistent attributes. This Skill provides a cohesive framework to compose pipelines using slog-multi, slog-sampling, and slog-formatter to route, filter, and format logs.

Core Features & Use Cases

  • Composed pipelines: slog-multi with Router, Fanout, Pool, and Pipe for middleware.
  • Throughput control: slog-sampling to drop noise while preserving critical logs.
  • Attribute transformation: slog-formatter to scrub PII and enrich logs.
  • HTTP middlewares and backend sinks: integration with slog-gin, slog-chi, slog-loki, slog-sentry, and more.
  • Real-world usage: route errors to Sentry while non-errors stream to Loki or stdout.

Quick Start

Create a logger by composing slog-multi with sampling, formatter, and routing to send errors to Sentry and other levels 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 route Go slog logs to different backends like Sentry and Loki?

You can route Go slog logs to different backends by composing a multi-handler pipeline using slog-multi. This allows you to direct errors to Sentry and informational logs to Loki simultaneously.

What is the best way to reduce log noise in a Go application using slog?

To reduce log noise in a Go application, you can use slog-sampling within your pipeline to drop noisy logs while preserving critical ones, ensuring reliable log throughput control.

Can I scrub PII from structured logs in Golang before sending them to a sink?

Yes, you can scrub PII from structured logs in Golang by applying attribute transformation with slog-formatter, which enriches and sanitizes log attributes before routing.

Does slog integration work with HTTP middlewares like Gin and Chi?

slog integration works with HTTP middlewares through dedicated backend sinks like slog-gin and slog-chi, enabling structured logging directly within your web routing pipeline.

How do I compose a slog pipeline for log formatting and fanout in Go?

You compose a slog pipeline for log formatting and fanout in Go using slog-multi features like Router, Fanout, Pool, and Pipe to manage middleware, routing, and formatting cohesively.