https://github.com/betterstack-community/go-logging-benchmarks
A comparison of the top logging libraries for Go
https://github.com/betterstack-community/go-logging-benchmarks
Last synced: about 1 year ago
JSON representation
A comparison of the top logging libraries for Go
- Host: GitHub
- URL: https://github.com/betterstack-community/go-logging-benchmarks
- Owner: betterstack-community
- License: apache-2.0
- Created: 2023-09-11T17:49:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-23T00:21:10.000Z (about 1 year ago)
- Last Synced: 2025-03-24T12:55:32.807Z (about 1 year ago)
- Language: Go
- Homepage: https://betterstack-community.github.io/go-logging-benchmarks/
- Size: 716 KB
- Stars: 40
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Logging Benchmarks

This repo compares the performance of popular
[Go Logging Libraries](https://betterstack.com/community/guides/logging/best-golang-logging-libraries/)
including the new Slog package.
[See the results](https://betterstack-community.github.io/go-logging-benchmarks/).
The following libraries are being tested:
- [Zerolog](https://github.com/rs/zerolog)
- [Zap](https://github.com/uber-go/zap)
- [Apex/log](https://github.com/apex/log)
- [Logrus](https://github.com/sirupsen/logrus)
- [Slog](https://pkg.go.dev/log/slog)
- [SlogZap](https://github.com/uber-go/zap/tree/master/exp/zapslog) (Slog with
Zap backend)
- [Phuslog](https://github.com/phuslu/log)
- [Log15](https://github.com/inconshreveable/log15)
- [Logf](https://github.com/zerodha/logf)
## 🟢 Prerequisites
You only need [a recent version of Go](https://go.dev/doc/install) to execute
the benchmarks.
## 📦 Getting started
- Clone the repository to your computer:
```bash
git clone https://github.com/betterstack-community/go-logging-benchmarks
```
```bash
cd go-logging-benchmarks
```
- Download the dependencies:
```bash
go mod tidy
```
- Execute the benchmarks:
```bash
go test -bench=. -benchmem
```
## ⚖ License
The code used in this project and in the linked tutorial are licensed under the
[Apache License, Version 2.0](LICENSE).
## 🤝 Contribute
If you found an issue with the benchmarks, or you want to propose a new library
for benchmarking, please open an issue or pull request accordingly.