Install and use lumberjack.v2
v2.0Lumberjack is a Go package for writing logs to rolling files. It is designed as a pluggable component that implements io.WriteCloser, making it compatible with any logging package that accepts an io.Writer (such as the standard library's log package).
Important: This is v2.0 and must be imported using gopkg.in:
import "gopkg.in/natefinch/lumberjack.v2"Warning: Lumberjack assumes that only one process is writing to the output files. Using the same configuration from multiple processes on the same machine will result in improper behavior.
import "gopkg.in/natefinch/lumberjack.v2"