// Set the Lumberjack logger
lumberjackLogger := &lumberjack.Logger{
Filename: "/var/log/misc.log",
MaxSize: 10,
MaxBackups: 3,
MaxAge: 3,
LocalTime: true,
}
// Add Lumberjack hook
hook, err := logrus_lumberjack.NewLumberjackHook(lumberjackLogger)
if err != nil {
logrus.Fatalln("Unable to add the Lumberjack hook :", err)
} else {
logrus.AddHook(hook)
}
-
Notifications
You must be signed in to change notification settings - Fork 3
fallais/logrus-lumberjack-hook
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|