Registry / logging / gotomicro-logrotate

gotomicro-logrotate

JSON →
library0.0.0-20211108034117-46d53eedc960gogounverified

A rolling logger that writes to io.Writer, designed as a pluggable component for logging infrastructure.

go get github.com/gotomicro/logrotate
INSTALL
IMPORT
SIG · GOTOMICRO-LOGROTAT
G
gotomicro-logrotate
logginggov0.0.0-20211108034117-46d53eedc960
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lumberjack
gopkg.in/natefinch/lumberjack.v2

Set up log rotation with lumberjack.

package main import ( "log" "gopkg.in/natefinch/lumberjack.v2" ) func main() { log.SetOutput(&lumberjack.Logger{ Filename: "/var/log/myapp.log", MaxSize: 500, // megabytes MaxBackups: 3, MaxAge: 28, // days }) log.Println("Hello, world!") }
Debug
Known issues
gotchaOnly one process should write to the output files; multiple processes will cause improper behavior.
fix
Ensure only one process uses the same lumberjack configuration.
affects: all
Upgrade
Version history
0.0.0-20211108034117-46d53eedc960latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
Resources
gotomicro-logrotate — go get gotomicro-logrotate · libregistry