An auto-rotating io.Writer implementation for Go with multiple rolling policies and parallel-safe writers.
RollingWriter is a Go library that implements an auto-rotating io.Writer, automatically managing log file rotation based on time or size policies. It solves the problem of unbounded log file growth by providing configurable rotation and cleanup, making it ideal for logging in long-running applications.
Go developers building applications that require robust logging with automatic file rotation, such as servers, daemons, or distributed systems.
Developers choose RollingWriter for its simplicity, performance, and built-in support for concurrent writes, offering multiple writer types (locked, async, buffered) to fit different use cases without sacrificing safety or efficiency.
Rolling writer is an IO util for auto rolling write in 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.
Provides locked, async, and buffered writers that ensure thread-safe logging in multi-goroutine applications, as demonstrated in the benchmark results with low allocation overhead.
Supports time-based and size-based rotation through extensible managers, allowing customizable log file management without manual intervention.
Includes a maximum retention limit to automatically delete old log files, preventing disk space issues in long-running processes.
Benchmarks show efficient write operations with minimal latency and memory allocations, making it suitable for high-throughput logging scenarios.
Focuses solely on io.Writer rotation; lacks built-in support for log levels, structured formatting, or hooks, requiring integration with other libraries for full logging capabilities.
Requires explicit setup and tuning for policies and writer types, which can be more involved compared to drop-in logging solutions that abstract these details.
The README mentions an upcoming v2.0, which may introduce breaking changes or require migration efforts, adding uncertainty for production use.