set gin log

pull/218/head
wenxu12345 3 years ago
parent b91b298174
commit 0a8fdc6cc8

@ -6,12 +6,17 @@ import (
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"flag" "flag"
"io"
"os"
"strconv" "strconv"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
func main() { func main() {
gin.SetMode(gin.ReleaseMode)
f, _ := os.Create("../logs/api.log")
gin.DefaultWriter = io.MultiWriter(f)
r := gin.Default() r := gin.Default()
r.Use(utils.CorsHandler()) r.Use(utils.CorsHandler())

Loading…
Cancel
Save