Structured Logging with slog
Explains the design goals and usage patterns behind Go's structured logging package.
Explains the design goals and usage patterns behind Go’s structured logging package.
- Author: Jonathan Amsterdam
- Authority: primary
- Kind: blog
- URL: https://go.dev/blog/slog
What it covers
- slog design goals
- structured logging patterns
- logger composition guidance
Why authoritative
Official Go blog post introducing slog and its intended usage.
Use when
- what is the intended slog pattern in Go
- why did Go add slog
- how should structured logging look in Go
Keywords
- slog, structured logging, logging, contextual logs, Go blog