+3
-5
@@ -1,19 +1,17 @@
|
||||
package lumberjack_test
|
||||
package lumberjack
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
)
|
||||
|
||||
// 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{
|
||||
log.SetOutput(&Logger{
|
||||
Filename: "/var/log/myapp/foo.log",
|
||||
MaxSize: 500, // megabytes
|
||||
MaxBackups: 3,
|
||||
MaxAge: 28, // days
|
||||
MaxAge: 28, // days
|
||||
Compress: true, // disabled by default
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user