Menu

1 / 2

slog Beyond Basics: Group, ReplaceAttr, and Custom Handlers

DEV Community·Gabriel Anhaia·6 months ago
#S6LRx21f
#go#observability#logging#stdlib#slog
Reading 0:00
15s threshold

Book: The Complete Guide to Go Programming

Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go

My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools

Me: xgabriel.com | GitHub

Most slog posts stop at slog.Info("hello", "user_id", 42) . That covers the first week. Then somebody opens a bug report asking why email is showing up in cleartext in CloudWatch, and a week later the SRE team asks why your error logs aren't reaching Sentry.

slog has the answers wired into the API. They live in three corners of the package most posts skip: slog.Group , HandlerOptions.ReplaceAttr , and the Handler interface itself.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.