On this page
Overview
Zap is a structured logging library for Go. It provides a typed Logger designed to minimize reflection and allocations plus a SugaredLogger for key-value and printf-style calls, with JSON encoders, levels, sampling, and Core composition for production logging.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Emit structured logs with typed fields and minimal reflection
Logger accepts typed fields such as zap.String, zap.Int, and zap.Duration, emphasizing predictable serialization and type-safe structured context.
Sources: [2]
Trade some strictness for ergonomics with SugaredLogger and compose output through Core/Encoder
SugaredLogger supports loosely typed key-value pairs and printf-style APIs. Core and Encoder composition controls levels, sinks, encoding, and the logging pipeline.
Sources: [2]
Best fit
Fits high-throughput Go backends that need structured logs with controlled overhead
It is useful on request paths and worker loops where JSON structured logs and level control are required but serialization and allocation overhead matter.
Sources: [2]
Before adoption
v1.28.0 declares Go 1.19 while the README support policy covers the two most recent minor Go versions
The v1.28.0 go.mod declares Go 1.19, while the README states that Zap supports only the two most recent minor Go releases. Version 1.28.0 adds CheckPreWriteHook and CheckedEntry.Before, so custom Core and Hook implementations should regression-test entry transformation order.
Official sources
- [1]uber-go/zap — GitHub repository(2026-10-06)
- [2]Zap v1.28.0 — README(2026-10-06)
- [3]Zap v1.28.0 — go.mod(2026-10-06)
- [4]Zap v1.28.0 release(2026-10-06)
- [5]Zap MIT license(2026-10-06)
Supplemental curator note
Use the typed Logger on hot paths and the SugaredLogger when looser key-value or printf-style calls improve ergonomics. Benchmark with representative fields, encoders, sinks, and sampling rather than relying on headline numbers alone.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/uber-go/zap.git - 2
Enter the repository
cd zap - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
24,664 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 3
- Open PRs
- 73
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- golang
- logging
- structured-logging
- zap
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Sentry Cocoa1,124 Stars
1 shared tag(s) · 2 shared category(s)
capture errors, crashes, and performance context from Apple applications with the official Sentry SDK
Swift - Lazygit82,894 Stars
1 shared tag(s) · 1 shared category(s) · Same language
Bring staging, commits, branches, rebases, worktrees, and reflog operations into a keyboard-driven terminal Git UI
Go - zerolog12,514 Stars
3 shared tag(s) · 2 shared category(s) · Same language
build JSON or CBOR log events with a low-allocation chaining API in Go
Go - Grafana Loki28,990 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Aggregate large log volumes with Prometheus-style label indexes, LogQL, Grafana, and multi-tenant operations
Go - opa12,323 Stars
2 shared tag(s) · Same language
Define authorization and configuration rules in Rego and evaluate them separately
Go - ZEN Engine2,037 Stars
2 shared tag(s)
define a business decision once in JSON and deliver it across runtimes
Rust
Report incorrect information
Tell us if any listing information is incorrect or outdated.