diff --git a/main.go b/main.go index 92af5d4..9ec5f81 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/web/controller.go b/web/controller.go index 6394926..729fe0e 100644 --- a/web/controller.go +++ b/web/controller.go @@ -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"))) } }