소스 검색

修复日志存储名称问题

Signed-off-by: allan716 <[email protected]>
allan716 3 년 전
부모
커밋
d7a9130816
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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),