gurkan0791 / rotatefilehook

This is a logrus hook for rotating log files. This is basically a wrapper around the lumberjack library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RotateFileHook

This is a simple hook for logrus to write log files using https://github.com/natefinch/lumberjack

import ("github.com/snowzach/rotatefilehook")

rotateFileHook, err := rotatefilehook.NewRotateFileHook(rotatefilehook.RotateFileConfig{
    Filename: "logfile.log",
    MaxSize: 5,
    MaxBackups: 7,
    MaxAge: 7,
    Level: logrus.LevelDebug,
    Formatter: logrus.TextFormatter,
})

About

This is a logrus hook for rotating log files. This is basically a wrapper around the lumberjack library.

License:MIT License


Languages

Language:Go 100.0%