将日志目录移动到config子目录,方便docker映射

This commit is contained in:
johlanse 2022-07-29 16:02:41 +08:00
parent fb4c46279c
commit d41bba79b6
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ func init() {
TimestampFormat: "2006-01-02 15:04:05",
LogFormat: "[%time%] [%lvl%]: %msg% \n",
}
w, err := rotates.New(path.Join("logs", "%Y-%m-%d.log"), rotates.WithRotationTime(time.Hour*24))
w, err := rotates.New(path.Join("config", "logs", "%Y-%m-%d.log"), rotates.WithRotationTime(time.Hour*24))
if err != nil {
log.Errorf("rotates init err: %v", err)
panic(err)

View File

@ -271,7 +271,7 @@ func stopStudy() gin.HandlerFunc {
func getLog() gin.HandlerFunc {
return func(ctx *gin.Context) {
ctx.File(fmt.Sprintf("./logs/%v.log", time.Now().Format("2006-01-02")))
ctx.File(fmt.Sprintf("./config/logs/%v.log", time.Now().Format("2006-01-02")))
}
}