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