Registry / logging / natefinch-lumberjack-v2

natefinch-lumberjack-v2

JSON →
library2.2.1gogounverified

Package lumberjack provides a rolling logger.

go get gopkg.in/natefinch/lumberjack.v2
INSTALL
IMPORT
SIG · NATEFINCH-LUMBERJA
N
natefinch-lumberjack-v2
logginggov2.2.1
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

Configure the standard logger to write to a rolling log file using 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("This is a log entry") }
Debug
Known issues
gotchaLumberjack does not support concurrent writes from multiple processes; use with caution in multi-process environments.
fix
Ensure only one process writes to the same log file, or use a different logging solution.
affects: all
Upgrade
Version history
2.2.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
natefinch-lumberjack-v2 — go get natefinch-lumberjack-v2 · libregistry