golang-samber-slog

Compose Go logging pipelines with samber/slog sampling, formatting, and routing.

5|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/omarluq/og-template --skill golang-samber-slog-omarluq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-slog
Source: https://github.com/omarluq/og-template/tree/main/.agents/skills/golang-samber-slog
Command: npx skills add https://github.com/omarluq/og-template --skill golang-samber-slog-omarluq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go logging using samber/slog can be complex to compose correctly; this Skill helps orchestrate multi-step pipelines with sampling, formatting, and routing.

Core Features & Use Cases

  • Composable pipelines: sampling, formatting, routing, and sinks via slog-multi, slog-sampling, and slog-formatter.
  • Predicate-based routing: send errors to Sentry, info to Loki, warn to Slack using Router/FirstMatch patterns.
  • HTTP middleware compatibility: integrate with slog-gin, slog-chi, slog-echo, etc.
  • Use Case: A production service with log volume control, sensitive data scrubbing, and multi-backend sinks.

Quick Start

Configure a Go service by composing sampling, formatting, and routing pipelines with slog-multi, slog-sampling, and slog-formatter.

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 sinks like Sentry and Loki?

Route Go slog logs to different sinks by composing predicate-based routing pipelines using slog-multi Router/FirstMatch patterns, directing errors to Sentry, info to Loki, and warnings to Slack.

What is the best way to control log volume in Go slog pipelines?

Control log volume in Go slog pipelines by applying the slog-sampling middleware as the outermost layer in your composable pipeline, filtering high-throughput logs before they reach formatting and routing stages.

Can I use samber slog with HTTP frameworks like Gin or Chi?

Yes, samber slog integrates with HTTP middleware through slog-gin, slog-chi, and slog-echo, enabling request logging within your composable Go slog pipeline for observable services.

Does Go slog pipeline composition require a specific Go version?

Composing samber slog pipelines requires Go 1.21 or higher and the versioned slog libraries for slog-multi, slog-sampling, and slog-formatter to function correctly.

How do I format Go slog entries before routing them to external sinks?

Format Go slog entries by inserting the slog-formatter middleware into your pipeline, scrubbing sensitive data and standardizing log structures before routing them to targeted sinks.

Why should I use slog-multi for Go logging instead of standard slog?

Use slog-multi over standard slog when your Go service requires composable multi-step pipelines for high-throughput logs, combining predicate-based routing, volume sampling, and multi-backend sinks.