talira

Structured, pluggable logging for Go

open sourceMITfree

Logrus is a structured logger for Go, completely API compatible with the standard library's logger. Log entries carry fields (WithFields) and levels, and are written as colour-coded text in a terminal, plain text, or JSON, with hooks that send entries to other systems. It helped make structured logging common in Go. It's in maintenance mode: security, bug fixes and performance only, plus interoperability with Go's log/slog, and its README points new projects to Zerolog, Zap and Apex.

Problems it solves

  • add structured logging with fields to a Go service
  • log JSON from a Go app for my log aggregator
  • replace Go's standard logger without rewriting every call
  • send Go log entries to an external service with hooks

Features

  • API compatible with the standard library logger
  • fields and log levels
  • text, colour and JSON formatters
  • hooks to send entries elsewhere

Limitations

  • In maintenance mode: security fixes, bug fixes and performance only, with no new features planned1

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what Logrus does.

  1. zap Fast, structured, leveled logging for Go
  2. ZAP The world's most widely used web app scanner. Free and open source.

Compare Logrus with the top 3