OSS TanbouSign in with GitHub

choose typed fields or a SugaredLogger for high-performance structured logging in Go

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
24,664
Primary language
Go
License
MIT
Repository last updated
Sep 16, 2026
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.

Sources: [3][2][4]

Official sources

  1. [1]uber-go/zap — GitHub repository(2026-10-06)
  2. [2]Zap v1.28.0 — README(2026-10-06)
  3. [3]Zap v1.28.0 — go.mod(2026-10-06)
  4. [4]Zap v1.28.0 release(2026-10-06)
  5. [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. 1

    Get the source

    git clone --depth 1 https://github.com/uber-go/zap.git
  2. 2

    Enter the repository

    cd zap
  3. 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
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • golang
  • logging
  • structured-logging
  • zap
Stars
24,664
Forks
1,567
Watchers
246
Open issues
123
Contributors
143
Owner type
Organization
Primary language
Go
License
MIT
Repository last updated
Sep 16, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?