...

Source file src/gopkg.in/natefinch/lumberjack.v2/example_test.go

Documentation: gopkg.in/natefinch/lumberjack.v2

     1  package lumberjack
     2  
     3  import (
     4  	"log"
     5  )
     6  
     7  // To use lumberjack with the standard library's log package, just pass it into
     8  // the SetOutput function when your application starts.
     9  func Example() {
    10  	log.SetOutput(&Logger{
    11  		Filename:   "/var/log/myapp/foo.log",
    12  		MaxSize:    500, // megabytes
    13  		MaxBackups: 3,
    14  		MaxAge:     28,   // days
    15  		Compress:   true, // disabled by default
    16  	})
    17  }
    18  

View as plain text