adjust log directory

This commit is contained in:
nuknal
2024-07-18 10:47:38 +08:00
parent 02c042d8c4
commit 839a8648f5

View File

@@ -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),
)