go-log-libraries

command module
v0.0.0-...-15f4dee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

Go log libraries

Project to compare Golang logging libraries

Libraries (sorted by performances)

  1. zerolog
  2. zap
  3. logrus
  4. fmt (package included)
  5. log (package included)

Usage samples

export GO111MODULE=on

go run zerolog.go

go run zap.go

go run logrus.go

Benchmark

Inside an application
Run server
export GO111MODULE=on
go run compare.go
Run single-print load test
go get github.com/tsliwowicz/go-wrk

go-wrk -c 1000 -d 10 -T 20000 http://0.0.0.0:8080/zerolog

go-wrk -c 1000 -d 10 -T 20000 http://0.0.0.0:8080/zap

go-wrk -c 1000 -d 10 -T 20000 http://0.0.0.0:8080/logrus
Run multiple-prints load test
go get github.com/tsliwowicz/go-wrk

go-wrk -c 1000 -d 10 -T 20000 http://0.0.0.0:8080/zerolog100

go-wrk -c 1000 -d 10 -T 20000 http://0.0.0.0:8080/zap100

go-wrk -c 1000 -d 10 -T 20000 http://0.0.0.0:8080/logrus100
Run context switches and syscalls monitor
sudo strace -c -t -p $(pid)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL