2
0
Files
lumberjack/example_test.go
T
2014-07-18 16:23:35 -04:00

19 lines
389 B
Go

package lumberjack_test
import (
"log"
"github.com/natefinch/lumberjack"
)
// To use lumberjack with the standard library's log package, just pass it into
// the SetOutput function when your application starts.
func Example() {
log.SetOutput(&lumberjack.Logger{
Filename: "/var/log/myapp/foo.log",
MaxSize: 500, // megabytes
MaxBackups: 3,
MaxAge: 28, // days
})
}