An opinionated, structured logging toolkit for Go that is both human and machine readable.
log15 is a structured logging library for Go that provides a simple, composable toolkit for best-practice logging. It is designed to be both human and machine readable, offering an alternative to Go's standard log package with features like key/value context, child loggers, and flexible handler configurations.
Go developers who need structured, readable logging with flexible configuration options, particularly those building applications where log data must be both human-friendly and machine-parsable.
Developers choose log15 for its opinionated, minimal API that promotes structured logging best practices, its compatibility with Go's standard library design, and its built-in support for various outputs like terminals, files, and syslog.
Structured, composable 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.
Encourages key/value pairs for machine-readable logs, as shown in examples where log messages include context like 'rate=0.500' and 'module=app/server'.
Simple Handler interface allows custom configurations to files, streams, syslog, and networks, demonstrated by MultiHandler and FileHandler in the examples section.
Child loggers enable modular logging by inheriting and adding private context, useful in microservices, as seen with 'connlog := srvlog.New("raddr", c.RemoteAddr())'.
Defers expensive operations until necessary, improving performance, shown with 'log.Lazy{pingRemote}' for deferred latency calculation.
The master branch API is considered unstable, requiring users to vendor the library for stability, as explicitly stated in the Versioning section.
Has undergone disruptive API changes, such as removing the Call property in v3 and dropping support for certain handlers, which complicates upgrades.
READMe admits Go's log/slog might be a better fit, indicating it lacks newer features like built-in structured context or broader ecosystem integrations.