|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"os"
|
|
|
"path/filepath"
|
|
|
"strings"
|
|
|
+ "time"
|
|
|
|
|
|
"github.com/natefinch/lumberjack"
|
|
|
"github.com/sirupsen/logrus"
|
|
|
@@ -28,7 +29,8 @@ func InitLogger(logDir string, levelConf string) {
|
|
|
panic(err)
|
|
|
}
|
|
|
|
|
|
- logFile := filepath.Join(logPath, "policy-service.log")
|
|
|
+ currentDate := time.Now().Format("20060102")
|
|
|
+ logFile := filepath.Join(logPath, "policy-service-"+currentDate+".log")
|
|
|
|
|
|
// 配置日志切割
|
|
|
lumberjackLogger := &lumberjack.Logger{
|