Logging

74 projects

Since Go 1.21, the standard library includes log/slog, a structured logger with levels, key-value attributes, and built-in JSON and text handlers. Its Handler interface lets other libraries plug in output formats and destinations, which has changed how Go logging libraries are built. This category covers full logging libraries, slog handlers and adapters, log file rotation, debug pretty printers and terminal log viewers.

uber-go/zap is a fast structured logger with a strongly typed Logger and a looser SugaredLogger. rs/zerolog writes JSON with a chained API and avoids allocations on hot paths. Sirupsen/logrus was the most popular structured logger before these, and its maintainers describe it as being in maintenance mode. For slog, lmittmann/tint adds colored console output, and samber's slog-multi plus many slog adapters route records to Zap, Zerolog, Sentry, Loki and others. natefinch/lumberjack rotates log files, glog provides leveled logs in Google style, and spew and pp pretty-print Go values while debugging.

For new code, start with log/slog so libraries and applications share one API, and swap handlers as needs grow. Choose zap or zerolog directly when profiling shows logging cost matters, since both can also back a slog handler. Keep logrus for existing codebases rather than new ones, and log structured fields rather than formatted strings.

logrusby Sirupsen

Structured logger for Go.

github.com/sirupsen/logrusGo 1.23+ 2 dependenciesv1.10.2updated 1mo ago

25.8k

zapby uber-go

Fast, structured, leveled logging in Go.

go.uber.org/zapGo 1.19+ 4 dependenciesv1.28.0updated 1mo ago

24.7k

zerologby rs

Zero-allocation JSON logger.

github.com/rs/zerologGo 1.23+ 4 dependenciesupdated 19d ago

12.5k

spewby davecgh

Implements a deep pretty printer for Go data structures to aid in debugging.

updated 2y ago

6.4k

lumberjackby natefinch

Simple rolling logger, implements io.WriteCloser.

gopkg.in/natefinch/lumberjack.v2Go 1.13+ No dependencies v2.2.1updated 2y ago

5.5k

glogby golang

Leveled execution logs for Go.

github.com/golang/glogGo 1.19+ No dependencies v1.2.5updated 1y ago

3.6k

tailby hpcloud

Go package striving to emulate the features of the BSD tail program.

updated 4y ago

2.8k

ppby k0kubun

Colored pretty printer for Go language.

github.com/k0kubun/pp/v3Go 1.26+ 2 dependenciesv3.5.1updated 1d ago

2.1k

seelogby cihub

Logging functionality with flexible dispatching, filtering, and formatting.

v2.6updated 7y ago

1.6k

lazyjournalby Lifailon

A TUI for reading and filtering logs from journalctl, file system, Docker and Podman containers, as well Kubernetes pods.

github.com/Lifailon/lazyjournalGo 1.25+ 3 dependencies0.8.6updated 1d ago

1.4k

logby apex

Structured logging package for Go.

github.com/apex/logGo 1.13+ 15 dependenciesupdated 3y ago

1.4k

tintby lmittmann

A slog.Handler that writes tinted logs.

github.com/lmittmann/tintGo 1.21+ No dependencies v1.2.1updated 1mo ago

1.4k

sentry-goby getsentry

Sentry SDK for Go. Helps monitor and track errors with real-time alerts and performance monitoring.

github.com/getsentry/sentry-goGo 1.26+ 8 dependenciesv0.50.0updated 1d ago

1.1k

log15by inconshreveable

Simple, powerful logging for Go.

github.com/inconshreveable/log15Go 1.24+ 2 dependenciesupdated 5mo ago

1.1k

phuslu/logby phuslu

High performance structured logging.

github.com/phuslu/logGo 1.22+ No dependencies updated 24d ago

879

slog-multiby samber

Chain of slog.Handler (pipeline, fanout...).

github.com/samber/slog-multiGo 1.22+ 4 dependenciesv1.9.0updated 10d ago

642

slogby gookit

Lightweight, configurable, extensible logger for Go.

github.com/gookit/slogGo 1.19+ 5 dependenciesv0.7.1updated 2d ago

557

httprettyby henvic

Pretty-prints your regular HTTP requests on your terminal for debugging (similar to http.DumpRequest).

github.com/henvic/httprettyGo 1.25+ 1 dependencyv0.2.0updated 2mo ago

457

onelogby francoispqt

Onelog is a dead simple but very efficient JSON logger. It is the fastest JSON logger out there in all scenarios. Also, it is one of the logger with the lowest allocation.

github.com/francoispqt/onelog2 dependencies0.14.0updated 7y ago

413

sqldb-loggerby simukti

A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

github.com/simukti/sqldb-loggerGo 1.17+ 1 dependencyupdated 11mo ago

379

logutilsby hashicorp

Utilities for slightly better logging in Go (Golang) extending the standard logger.

github.com/hashicorp/logutilsNo dependencies updated 5mo ago

371

logxiby mgutz

12-factor app logger that is fast and makes you happy.

updated 6y ago

354

logby go-playground

Simple, configurable and scalable Structured Logging for Go.

github.com/go-playground/log/v8Go 1.18+ 3 dependenciesv8.1.2updated 3y ago

293

rollingwriterby arthurkiller

RollingWriter is an auto-rotate io.Writer implementation with multi policies to provide log file rotation.

github.com/arthurkiller/rollingwriterGo 1.12+ 2 dependenciesv1.1.2.1updated 3y ago

292

go-loggerby apsdehal

Simple logger of Go Programs, with level handlers.

1.3.0updated 7y ago

287

slog-formatterby samber

Common formatters for slog and helpers to build your own.

github.com/samber/slog-formatterGo 1.22+ 5 dependenciesv1.3.0updated 1d ago

227

glgby kpango

Glg is simple and fast leveled logging library for Go.

github.com/kpango/glgGo 1.21+ 4 dependenciesv1.6.15updated 9mo ago

193

timberjackby DeRuina

Rolling logger with size-based, time-based, and scheduled clock-based rotation, supporting compression and cleanup.

github.com/DeRuina/timberjackGo 1.24+ 2 dependenciesv1.4.9updated 16d ago

171

loggerby azer

Minimalistic logging library for Go.

github.com/azer/loggerGo 1.18+ 1 dependencyupdated 9mo ago

159

xlogby rs

Structured logger for net/context aware HTTP handlers with flexible dispatching.

updated 2y ago

141

ozzo-logby go-ozzo

High performance logging supporting log severity, categorization, and filtering. Can send filtered log messages to various targets (e.g. console, network, mail).

updated 6d ago

123

slog-lokiby samber

A slog handler for Grafana Loki.

github.com/samber/slog-loki/v3Go 1.24+ 5 dependenciesv3.7.2updated 1d ago

82

slog-zerologby samber

A slog handler for Zerolog.

github.com/samber/slog-zerolog/v2Go 1.21+ 3 dependenciesv2.9.2updated 3mo ago

76

caarlos0/logby caarlos0

Colorful CLI logger.

github.com/caarlos0/logGo 1.25+ 2 dependenciesv0.6.2updated 1d ago

65

go-cronowriterby utahta

Simple writer that rotate log files automatically based on current date and time, like cronolog.

github.com/utahta/go-cronowriterGo 1.11+ 1 dependencyv1.2.0updated 5y ago

56

slog-zapby samber

A slog handler for Zap.

github.com/samber/slog-zap/v2Go 1.21+ 3 dependenciesv2.7.0updated 3mo ago

55

slog-sentryby samber

A slog handler for Sentry.

github.com/samber/slog-sentry/v2Go 1.24+ 4 dependenciesv2.11.0updated 1d ago

54

gone/logby One-com

Fast, extendable, full-featured, std-lib source compatible log library.

updated 5y ago

51

stdlogby alexcesaro

Stdlog is an object-oriented library providing leveled logging. It is very useful for cron jobs.

updated 11y ago

48

journaldby ssgreg

Go implementation of systemd Journal's native API for logging.

github.com/ssgreg/journald2 dependenciesv1.0.0updated 5y ago

46

noodlogby gyozatech

Parametrized JSON logging library which lets you obfuscate sensitive data and marshal any kind of content. No more printed pointers instead of values, nor escape chars for the JSON strings.

github.com/gyozatech/noodlogGo 1.16+ No dependencies v1.0.2updated 3y ago

43

go-logby ian-kent

Log4j implementation in Go.

updated 8y ago

42

logexby chzyer

Golang log lib, supports tracking and level, wrap by standard log lib.

github.com/chzyer/logexGo 1.21+ No dependencies v1.2.1updated 2y ago

42

go-logby siddontang

Log lib supports level and multi handlers.

updated 7y ago

40

zaxby yuseferi

Integrate Context with Zap logger, which leads to more flexibility in Go logging.

github.com/yuseferi/zax/v2Go 1.26+ 2 dependenciesv2.5.0updated 1mo ago

39

mlogby jbrodriguez

Simple logging module for go, with 5 levels, an optional rotating logfile feature and stdout/stderr output.

updated 8y ago

33

slog-logrusby samber

A slog handler for Logrus.

github.com/samber/slog-logrus/v2Go 1.21+ 3 dependenciesv2.5.4updated 2mo ago

33

distillogby amoghe

Distilled levelled logging (think of it as stdlib + log levels).

updated 8y ago

32

logruslyby sebest

Logrus plug-in to send errors to a Loggly.

updated 5y ago

29

zkits-loggerby edoger

A powerful zero-dependency JSON logger.

github.com/edoger/zkits-loggerGo 1.18+ No dependencies v1.5.1updated 3y ago

28

logby teris-io

Structured log interface for Go cleanly separates logging facade from its implementation.

v1.0.0updated 8y ago

25

slog-slackby samber

A slog handler for Slack.

github.com/samber/slog-slack/v2Go 1.21+ 3 dependenciesv2.7.5updated 1d ago

23

kembaby clok

A tiny debug logging tool inspired by debug, great for CLI tools and applications.

github.com/clok/kembaGo 1.16+ 3 dependenciesv1.2.1updated 13d ago

18

logby heartwilltell

Simple leveled logging wrapper around standard log package.

github.com/heartwilltell/logGo 1.18+ No dependencies v1.1.3updated 3y ago

17

xylogby xybor-x

Leveled and structured logging, dynamic fields, high performance, zone management, simple configuration, and readable syntax.

github.com/xybor-x/xylogGo 1.18+ 3 dependenciesv0.5.0updated 3y ago

17

globy lajosbencz

PHP Monolog inspired logging facility with identical severity levels.

v0.1.0updated 7y ago

16

logrusiowriterby cabify

Io.Writer implementation using logrus logger.

github.com/cabify/logrusiowriterGo 1.12+ 1 dependencyv1.1.0updated 2y ago

16

slog-datadogby samber

A slog handler for Datadog.

github.com/samber/slog-datadog/v2Go 1.22+ 3 dependenciesv2.10.4updated 1d ago

16

go-logby subchen

Simple and configurable Logging in Go, with level, formatters and writers.

v3.0.0updated 8y ago

14

go-logby pieterclaerhout

A logging library with stack traces, object dumping and optional timestamps.

github.com/pieterclaerhout/go-logGo 1.25+ 5 dependenciesv1.15.0updated 2mo ago

11

zlby nkmr-jp

High Developer Experience, zap based logger. It offers rich functionality but is easy to configure.

github.com/nkmr-jp/zlGo 1.26+ 6 dependenciesv1.4.20updated 1d ago

11

logby aerogo

An O(1) logging system that allows you to connect one log to multiple writers (e.g. stdout, a file and a TCP connection).

github.com/aerogo/logGo 1.12+ 1 dependencyv0.1.0updated 7y ago

10

logdumpby ewwwwwqm

Package for multi-level logging.

updated 8y ago

10

GoLogXby AyoubTadlaoui

Append-only, hash-chained, optionally Ed25519-signed slog handler with offline verification of tampering.

github.com/AyoubTadlaoui/GoLogXGo 1.22+ No dependencies v0.3.0updated 4mo ago

8

xlogby xfxdev

Plugin architecture and flexible log system for Go, with level ctrl, multiple log target and custom log format.

updated 7y ago

8

slf4gby echocat

Simple Logging Facade for Golang: Simple structured logging; but powerful, extendable and customizable, with huge amount of learnings from decades of past logging frameworks.

github.com/echocat/slf4gGo 1.18+ No dependencies v1.9.0updated today

6

structy/logby structy

A simple to use log system, minimalist but with features for debugging and differentiation of messages.

github.com/structy/logGo 1.17+ 1 dependencyupdated 4y ago

5

logby no-src

A simple logging framework out of the box.

github.com/no-src/logGo 1.19+ 1 dependencyv0.3.2updated 4mo ago

4

gslogby maguro

Google Cloud Logging handler for log/slog, with OpenTelemetry trace and baggage, and Kubernetes podinfo labels.

m4o.io/gslogGo 1.26+ 10 dependenciesv1.0.0updated 1d ago

3

go-log4g

Log4g provides Log4j-style configuration and pattern layouts for Go's standard log/slog logging facade.

github.com/go-log4g/coreGo 1.26+ 4 dependenciesv1.0.11updated 12d ago

1

yellby jfcg

Yet another minimalistic logging library.

github.com/jfcg/yellGo 1.15+ No dependencies updated 4y ago

1

slog-configuratorby psyb0t

Configures the standard library log/slog logger from environment variables: level, format, source location, and stdout/stderr split.

github.com/psyb0t/sloggingGo 1.26+ 2 dependenciesv1.7.1updated 3d ago

0
s

slogor

A colorful slog handler.

gitlab.com

Esc

Type to search every entry. ↑↓ to move, Enter to open.