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 plugins | plan not known |
|---|
Alternatives
The same job
These do what Logrus does.
