A minimalistic Go logging library with structured JSON output, advanced filtering, and performance timers.
logger is a minimalistic logging library for Go that provides structured JSON output, advanced filtering by package and log level, and performance timers. It solves the need for a simple yet flexible logging solution that works seamlessly in both development and production environments, with silent-by-default behavior to reduce noise.
Go developers who need a lightweight, production-ready logging library with structured output and customizable filtering for applications ranging from small tools to large-scale services.
Developers choose logger for its simplicity, minimal overhead, and practical features like JSON output for non-terminal environments, performance timers, and the ability to extend via hooks, all while being battle-tested in production since 2014.
Minimalistic logging library 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.
Allows precise control over log output by package and level using environment variables, as shown in the Filters section with examples like LOG=images@timer,users.
Automatically switches to JSON format in non-terminal environments for easy parsing, demonstrated in the Structured Output section with sample log lines.
Provides Timer() and End() methods to measure execution time, outputting elapsed duration in logs, useful for monitoring code performance.
Supports adding key-value pairs to log entries via logger.Attrs, enriching structured output with contextual data as shown in the Attributes section.
Enables custom writers and community hooks like Slack integration, allowing easy extension of logging behavior beyond default outputs.
Only supports info, timer, error, and mute levels, lacking common levels like debug or warn, which can restrict logging granularity for complex applications.
Filtering relies heavily on environment variables, offering less flexibility for dynamic, runtime configuration compared to programmatic APIs in other libraries.
With only one community hook mentioned (Slack), the library has fewer integrations and plugins, limiting out-of-the-box functionality compared to more popular alternatives.