A high-performance, dependency-free structured logging library for Go with a clean API and comprehensive writer support.
phuslog is a structured logging library for Go designed for extreme performance and minimal overhead. It provides a clean, fluent API and supports a wide variety of output writers, making it suitable for both development and production environments. It solves the need for high-throughput, low-latency logging in Go applications with zero allocations in common cases.
Go developers building high-performance applications where logging overhead is a critical concern, such as microservices, data pipelines, or real-time systems. It's also suitable for developers needing flexible output destinations like syslog, journald, or Windows Event Log.
Developers choose phuslog for its benchmark-proven performance, significantly outperforming other JSON loggers like slog, zap, and zerolog in speed and memory usage. Its unique selling point is combining this extreme performance with a dependency-free design, a clean fluent API, and seamless interoperability with Go's standard log and slog packages.
Fastest structured logging
Outperforms slog, zap, and zerolog in benchmarks with zero allocations in common cases, making it ideal for high-throughput applications where logging overhead is critical.
Includes a wide range of writers like FileWriter with rotation, AsyncWriter for throughput, and system-specific writers (SyslogWriter, JournalWriter, EventlogWriter) for flexible output destinations.
Provides adapters for Go's standard log package and slog, with SlogNewJSONHandler as a drop-in replacement that offers significant performance improvements over the standard handler.
No external dependencies, reducing project bloat and potential conflicts, as highlighted in the features list and philosophy.
FileWriter uses symlinks for rotation, which on Windows may require administrator privileges, complicating deployments in restricted environments.
The README explicitly warns against using ConsoleWriter on critical paths of high-concurrency applications due to potential performance degradation, limiting its use in production debugging.
Features like log rotation with compression or total size limits require writing custom Cleaner functions, adding setup overhead compared to loggers with built-in solutions.
Structured, pluggable logging for Go.
Blazing fast, structured, leveled logging in Go.
Zero Allocation JSON Logger
Implements a deep pretty printer for Go data structures to aid in debugging
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.