// 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)
}
harishdurga / logrus-lumberjack-hook Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fallais/logrus-lumberjack-hook
Logrus hook for Lumberjack