Commit fcdbed1c by yunpeng.song

日志切割时间给为2小时

parent af5cc75d
...@@ -27,9 +27,9 @@ func InitLog() { ...@@ -27,9 +27,9 @@ func InitLog() {
log.SetLevel(log.InfoLevel) log.SetLevel(log.InfoLevel)
logWriter, err := rotatelogs.New( logWriter, err := rotatelogs.New(
logName+".%Y-%m-%d-%H-%M.log", logName+".%Y-%m-%d-%H-%M.log",
rotatelogs.WithLinkName(logName), // 生成软链,指向最新日志文件 rotatelogs.WithLinkName(logName), // 生成软链,指向最新日志文件
rotatelogs.WithMaxAge(30*24*time.Hour), // 文件最大保存时间 rotatelogs.WithMaxAge(30*24*time.Hour), // 文件最大保存时间
rotatelogs.WithRotationTime(24*time.Hour), // 日志切割时间间隔 rotatelogs.WithRotationTime(2*time.Hour), // 日志切割时间间隔
//rotatelogs.WithRotationTime(1*time.Minute), //rotatelogs.WithRotationTime(1*time.Minute),
) )
writeMap := lfshook.WriterMap{ writeMap := lfshook.WriterMap{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment