Ver Fonte

修复日志存储名称问题

Signed-off-by: allan716 <[email protected]>
allan716 há 3 anos atrás
pai
commit
d7a9130816
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      internal/pkg/log_helper/loghelper.go

+ 1 - 1
internal/pkg/log_helper/loghelper.go

@@ -26,7 +26,7 @@ func NewLogHelper(appName string, level logrus.Level, maxAge time.Duration, rota
 	fileAbsPath := filepath.Join(pathRoot, appName+".log")
 	// 下面配置日志每隔 X 分钟轮转一个新文件,保留最近 X 分钟的日志文件,多余的自动清理掉。
 	writer, _ := rotatelogs.New(
-		filepath.Join(pathRoot, appName+"--%YLen%m%d%H%M--.log"),
+		filepath.Join(pathRoot, appName+"--%Y%m%d%H%M--.log"),
 		rotatelogs.WithLinkName(fileAbsPath),
 		rotatelogs.WithMaxAge(maxAge),
 		rotatelogs.WithRotationTime(rotationTime),