golang-samber-slog

Configure structured logging with samber/slog for Go applications.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-samber-slog-luigiapcpereira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-slog
Source: https://github.com/LuigiAPCPereira/evolutiondocs/tree/main/.agents/skills/golang-samber-slog
Command: npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-samber-slog-luigiapcpereira

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires github.com/samber/slog-*, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the challenge of logging in Golang by providing a comprehensive suite of structured logging extensions, making it easier to manage and analyze logs.

Core Features & Use Cases

  • Structured Logging: Implements structured logging using samber/slog packages, enhancing readability and maintainability of logs.
  • Multi-Handler Pipelines: Supports multi-handler pipelines for flexible logging configurations.
  • Log Sampling: Incorporates log sampling to control throughput and reduce noise in log data.
  • Attribute Formatting: Enables attribute formatting for enhanced log information.
  • HTTP Middleware: Integrates with popular web frameworks for easy logging.
  • Backend Routing: Routes logs to various backends like Datadog, Sentry, Loki, and more.
  • Use Case: A Go developer can use this Skill to set up a robust logging system for their application, improving observability and debugging capabilities.

Quick Start

Run the golang-samber-slog skill with the following command:

go run path/to/your/application

Frequently Asked Questions about golang-samber-slog

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

FAQPage Schema
How do I implement structured logging in Golang with multiple handlers?

Structured logging in Golang with multiple handlers is implemented using samber/slog packages to configure multi-handler pipelines. This allows flexible routing of log entries to various destinations simultaneously. The Skill provides scripts to set up these pipelines easily.

What is the best way to route Go application logs to Datadog and Sentry?

Routing Go application logs to Datadog and Sentry is achieved through backend routing configurations using samber/slog extensions. You can direct structured logs to various backends like Datadog, Sentry, and Loki by setting up the appropriate handlers in your logging pipeline.

How do I reduce log noise in a high-throughput Golang application?

Reducing log noise in a high-throughput Golang application is done through log sampling. The samber/slog libraries support sampling mechanisms to control log throughput, effectively reducing data volume and filtering out redundant entries during peak traffic.

Does the samber/slog package support HTTP middleware for web frameworks?

The samber/slog package supports HTTP middleware integration for popular web frameworks. This enables automatic request logging and attribute formatting within your web services, providing enhanced observability for incoming HTTP traffic.

Do I need specific dependencies to use samber/slog for structured logging?

You need the Go runtime and the samber/slog packages as dependencies to use this structured logging implementation. The Skill specifically leverages github.com/samber/slog-* libraries to provide its multi-handling, sampling, and backend routing features.