A structured logger for Go that is API-compatible with the standard library logger.
Logrus is a structured logging library for Go that serves as a drop-in replacement for the standard library logger. It provides enhanced functionality like structured logging with fields, multiple log levels, and pluggable hooks to send logs to external services. The project is currently in maintenance mode, focusing on security, bug fixes, and performance while recommending newer alternatives for active development.
Go developers who need structured logging in their applications, particularly those migrating from the standard library logger or maintaining legacy systems that already use Logrus. It's also suitable for teams requiring easy integration with external logging services like syslog, StatsD, or exception trackers.
Developers choose Logrus for its full API compatibility with Go's standard logger, enabling seamless migration without code changes, and its role in popularizing structured logging in the Go ecosystem. Its pluggable hooks and customizable formatters (like JSON and text with color support) offer flexibility for diverse logging needs in both development and production environments.
Structured, pluggable logging for Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Fully API-compatible with Go's standard logger, allowing drop-in replacement without code changes, as highlighted in the README for easy adoption.
Encourages logging with fields instead of unstructured text, with examples showing JSON formatting for tools like logstash and Splunk, enhancing log analysis.
Supports pluggable hooks to send logs to external services like syslog or StatsD, with a wiki listing community hooks for easy integration.
Provides color-coded console output in TTY environments by default, making debugging more intuitive, as shown in the README's screenshots.
Officially in maintenance mode with no new features being introduced, as the README states, limiting future enhancements and modern logging needs.
Enabling caller reporting adds 20-40% performance overhead, as noted in the README, which can impact latency-sensitive applications.
Historical casing problems require using lower-case imports (github.com/sirupsen/logrus), which can cause conflicts in projects with mixed dependencies.