Open sriram275 opened 5 years ago
Daily rotation files is also an option for me independently of size.
By the way, this is a duplicated of #54.
You can actually make a filename like this instead of a fixed filename value:
logFile := "logs/app_name_" + time.Now().Format("01-02-2006") + ".log" log.SetOutput(&lumberjack.Logger{ Filename: logFile, MaxSize: 500, // megabytes MaxBackups: 3, MaxAge: 28, //days Compress: true, // disabled by default })
a project timewriter impl daily rotate: timewriter @sriram275
Is that possible to rotate logger based on daily instead maxSize ? Since we want to rotate log file daily irrespectie of the log file size.
Thanks, Sriram