Skip to content

AlfredAlan/rotate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rotate

rotate is a file rolling package for Go

The package is similar to lumberjack but reduces the use of channel feature

How to use

writer, _ := rotate.NewRotateWriter(
    "/var/log/myapp/foo.log",
    rotate.WithMaxSize(500),   // megabytes
    rotate.WithKeepDays(30),   // days
    rotate.WithMaxBackups(100), 
)
log.SetOutput(&writer)

About

rotate is a file rolling package for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages