Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Everyone Logs Wrong with slog. 7 Patterns for 3 AM

DEV Community·Gabriel Anhaia·about 1 month ago
#kHcRzxZF
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 The aggregator returns two thousand lines that all say msg="error processing request" . No user. No order. No upstream. No trace id. The pager has been buzzing for half an hour, the checkout error rate is climbing past 4%, and the playbook said "check the logs." You scroll. You give up. You roll back the last deploy because you cannot tell from the logs which code path is failing. That is not a logging library problem. That is a logging discipline problem. log/slog has shipped in the standard library since Go 1.21 . It produces structured JSON. The primitives for making 3 AM logs answerable are all there.…

Continue reading — create a free account

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

Read More