From f87038622bdf6ca9eeba2e12eba136a9911fcf28 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 5 Apr 2022 15:07:34 +0800 Subject: [PATCH] set gin log --- cmd/Open-IM-SDK-Core | 2 +- cmd/open_im_api/main.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index 650b201aa..e2b32de2f 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit 650b201aa792c30261ddc94be07b809e67238b78 +Subproject commit e2b32de2f93ff46662104833c8de5d5b44a2f25d diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 45843432e..ce89a8564 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -14,6 +14,8 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "flag" + "io" + "os" "strconv" "github.com/gin-gonic/gin" @@ -21,7 +23,11 @@ import ( ) func main() { + gin.SetMode(gin.ReleaseMode) + f, _ := os.Create("../logs/api.log") + gin.DefaultWriter = io.MultiWriter(f) + r := gin.Default() r.Use(utils.CorsHandler()) // user routing group, which handles user registration and login services