Stage 01 · Write · Researched comparison
Best Go Logging Libraries in 2026
Uber's zap is the first pick for most teams that need fast, structured logging with typed fields and low allocation overhead. It suits services that log heavily and care about CPU and memory. For a zero-allocation JSON logger with a small API, look at zerolog. If you want the standard library only, Go's built-in log/slog covers structured logging without adding a dependency.
By Shihab Mia
Published 22 Nov 2026 · 6 tools compared
We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
- All six libraries listed here are free and open source, so cost is not the deciding factor.
- zap and zerolog focus on speed and low allocation; slog ships with Go 1.21 and later.
- logrus is in maintenance mode, so new projects should weigh that before adopting it.
- Every library here writes logs locally; none sends your data to a third-party web page.
Who each pick is for
- High-throughput services that need fast structured logszap
- JSON-first services that want minimal allocationszerolog
- Projects that want structured logging in the standard librarylog/slog
- Existing projects already built around its APIlogrus
- Codebases that prefer key-value context logginglog15
- go-kit services that need a minimal logging interfacego-kit/log
Comparison
| Tool | Best for | Standout feature | Listed starting price | Free plan or trial |
|---|---|---|---|---|
| 1zap | High-throughput services that need fast structured logs | Very fast structured logging | Free (open source) | Free plan |
| 2zerolog | JSON-first services that want minimal allocations | Zero-allocation JSON logging | Free (open source) | Free plan |
| 3log/slog | Projects that want structured logging in the standard library | Part of the Go standard library | Free (open source) | Free plan |
| 4logrus | Existing projects already built around its API | Simple API and wide adoption | Free (open source) | Free plan |
| 5log15 | Codebases that prefer key-value context logging | Context-based key-value API | Free (open source) | Free plan |
| 6go-kit/log | go-kit services that need a minimal logging interface | Small interface that is easy to wrap | Free (open source) | Free plan |
How we picked
We picked libraries that are maintained, have public repositories and genuinely handle structured logging in Go. Criteria were fit for the job, supported platforms, licence and price, whether logs stay local, and known limits such as maintenance status or Go version requirements. Sources are vendor pages, package documentation and project repositories. Prices and project status can change, so confirm details on the official site before you commit.
The tools, one by one
zap
Best for high-throughput services that need fast structured logs

What it is and where it fits
zap is Uber's structured logging library. It writes JSON or console output and supports strongly typed fields, which avoids reflection on the hot path. The package offers a low-level Logger API and a SugaredLogger wrapper with printf-style calls. It runs anywhere Go runs: Linux, macOS, Windows and containers.
zap is licensed under a permissive open-source licence and has no paid tier. Its main limits are configuration overhead and the split between the two APIs, which can confuse newcomers. Teams that want a minimal dependency or the standard library should skip it and use slog instead.
Standout: Very fast structured logging
Free (open source), as listed by the vendor (zap website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Very fast structured logging
- typed fields and a sugared API for simpler calls
Drawbacks
- More verbose setup than basic loggers
- two APIs to learn
Skip it if this limit matters to you: more verbose setup than basic loggers.
Verdict. A sensible pick for high-throughput services that need fast structured logs.
zerolog
Best for jSON-first services that want minimal allocations

What it is and where it fits
zerolog is a JSON logger built around a chained context API. It aims for zero allocations on common paths and outputs JSON by default, which fits log pipelines that parse structured events. It supports console writers for local development and hooks for custom output.
The project is open source with no paid plan. It runs on any platform Go supports. The chained API is concise but reads differently from printf-style loggers, so teams with mixed experience may prefer zap or slog. There is no hosted service, so shipping logs to a backend is your job.
Standout: Zero-allocation JSON logging
Free (open source), as listed by the vendor (zerolog website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Zero-allocation JSON logging
- chainable context API
Drawbacks
- Chain style can be awkward for some teams
- fewer built-in sinks than zap
Skip it if this limit matters to you: chain style can be awkward for some teams.
Verdict. A sensible pick for JSON-first services that want minimal allocations.
log/slog
Best for projects that want structured logging in the standard library

What it is and where it fits
log/slog is the standard library's structured logging package, added in Go 1.21. It provides leveled logging, key-value attributes and pluggable handlers, including built-in text and JSON handlers. Because it ships with Go, there is no third-party dependency to manage.
It is free with no paid tier and runs wherever your Go version runs. The main limit is version: projects pinned to older Go releases cannot use it without upgrading. It is less feature-rich than zap or zerolog for advanced encoding and sampling, but it is a solid default for new code.
Standout: Part of the Go standard library
Free (open source), as listed by the vendor (log/slog website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Part of the Go standard library
- handler-based design with JSON and text handlers
Drawbacks
- Added in Go 1.21, so older codebases need an upgrade
- fewer features than zap
Skip it if this limit matters to you: added in Go 1.21, so older codebases need an upgrade.
Verdict. A sensible pick for projects that want structured logging in the standard library.
logrus
Best for existing projects already built around its API

What it is and where it fits
logrus is a structured logger with a straightforward field-based API and a large ecosystem of hooks and formatters. It outputs text or JSON and has been widely used in Go projects for years.
The repository states the project is in maintenance mode, so new features are unlikely. It remains free and open source. For new services, zap, zerolog or slog are better long-term choices. logrus still makes sense where existing code and hooks already depend on it, and migrating would cost more than it saves.
Standout: Simple API and wide adoption
Free (open source), as listed by the vendor (logrus website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Simple API and wide adoption
- many hooks and formatters
Drawbacks
- Project is in maintenance mode
- slower than zap and zerolog
Skip it if this limit matters to you: project is in maintenance mode.
Verdict. A sensible pick for existing projects already built around its API.
log15
Best for codebases that prefer key-value context logging

What it is and where it fits
log15 is a structured logger built around key-value contexts. You attach context to a logger and pass it down, which keeps related fields together. It ships handlers for JSON, logfmt and terminal output, and supports leveled logging.
The library is free and open source. Development is slower than for zap or zerolog, and its API predates the slog conventions, so teams standardizing on slog may find it a mismatch. It is a reasonable fit for existing codebases that already use its context style and do not want to migrate.
Standout: Context-based key-value API
Free (open source), as listed by the vendor (log15 website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Context-based key-value API
- multiple handlers including JSON and logfmt
Drawbacks
- Less active than newer libraries
- API differs from slog conventions
Skip it if this limit matters to you: less active than newer libraries.
Verdict. A sensible pick for codebases that prefer key-value context logging.
go-kit/log
Best for go-kit services that need a minimal logging interface

What it is and where it fits
go-kit/log provides a small Logger interface and level wrappers. It is the logging package used across go-kit components, so services built on go-kit get consistent logging without extra glue. Output is handled by a logfmt-style encoder by default.
It is free and open source and runs on any Go platform. The main limit is scope: outside go-kit projects it offers less than zap, zerolog or slog. Teams not using go-kit should pick a standalone logger instead. For go-kit services, it keeps dependencies aligned and the interface small.
Standout: Small interface that is easy to wrap
Free (open source), as listed by the vendor (go-kit/log website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Small interface that is easy to wrap
- works well with go-kit components
Drawbacks
- Tied to the go-kit ecosystem
- fewer features than standalone loggers
Skip it if this limit matters to you: tied to the go-kit ecosystem.
Verdict. A sensible pick for go-kit services that need a minimal logging interface.
Who should use what
High-traffic services that log millions of events should start with zap or zerolog, depending on whether they prefer typed fields or a chained JSON API. New projects on Go 1.21 or later can use log/slog and avoid a dependency. Teams maintaining older code on logrus or log15 should keep it if migration cost is high, but avoid it for new services. go-kit users get the simplest path with go-kit/log, while small tools may find slog enough.
Questions to settle before you buy
What to check before you buy
- Confirm the library is actively maintained and check recent commits and releases.
- Check the Go version requirement, especially for log/slog.
- Decide whether you need JSON output, console output or both.
- Measure the allocation cost if you log on hot paths.
- Verify the licence fits your project and that logs stay in your own infrastructure.
FAQ
Is zap faster than zerolog?
Both are designed for low allocation and high throughput, and both are fast. The better choice depends on API style and your benchmark on your own workload. Run a benchmark with your log shapes rather than relying on general claims.
Should I use log/slog instead of a third-party logger?
For new projects on Go 1.21 or later, slog is a reasonable default because it is in the standard library. Choose zap or zerolog if you need more encoding options or sampling. Older codebases may need an upgrade first.
Is logrus still maintained?
The logrus repository states the project is in maintenance mode. It still works and is free, but new features are unlikely. New projects should consider zap, zerolog or slog instead.
Do these libraries send my logs anywhere?
No. They write logs to the outputs you configure, such as stdout, files or your own handlers. Sending logs to a remote service is a separate step you set up yourself.
Are these logging libraries free?
Yes. All six libraries listed are free and open source with no paid tier. You pay only for any infrastructure you use to store or ship the logs.
Sources we checked
Method: how we score · editorial policy.
Change log. First published 22 Nov 2026.