From 839a8648f5117087798ac32a20034036e6c2bfa2 Mon Sep 17 00:00:00 2001 From: nuknal Date: Thu, 18 Jul 2024 10:47:38 +0800 Subject: [PATCH] adjust log directory --- xlog/log.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlog/log.go b/xlog/log.go index f67c7d0..0a7f388 100644 --- a/xlog/log.go +++ b/xlog/log.go @@ -49,7 +49,8 @@ func init() { DisableColors: true, } - configureLogger(logrus.StandardLogger(), "log/SJY01-preproc.log", logrus.InfoLevel) + os.MkdirAll("log/SJY01ImageProc", 0755) + configureLogger(logrus.StandardLogger(), "log/SJY01ImageProc/preproc.log", logrus.InfoLevel) } func NewLogger(logfile string) *logrus.Logger { @@ -65,7 +66,7 @@ func configureLogger(logger *logrus.Logger, logfile string, level logrus.Level) writer, _ := rotatelogs.New( logfile+".%Y%m%d", rotatelogs.WithLinkName(logfile), - rotatelogs.WithMaxAge(time.Duration(30*24)*time.Hour), + rotatelogs.WithMaxAge(time.Duration(7*24)*time.Hour), rotatelogs.WithRotationTime(time.Duration(24)*time.Hour), )