|
@@ -28,7 +28,9 @@ func Middleware(r *ghttp.Request) {
|
|
queryLevel := getQueryLevel(bodyBytes)
|
|
queryLevel := getQueryLevel(bodyBytes)
|
|
r.SetCtxVar(consts.QueryLevelKey, queryLevel)
|
|
r.SetCtxVar(consts.QueryLevelKey, queryLevel)
|
|
r.Middleware.Next()
|
|
r.Middleware.Next()
|
|
- g.Log().Infof(r.Context(), "status:%d time:%fs waitPool:%fs level:%d from:%s query:%s", r.Response.Status, time.Since(now).Seconds(), r.GetCtxVar(consts.QueryWaitPoolTime).Float64(), queryLevel, r.GetClientIp(), string(bodyBytes))
|
|
|
|
|
|
+ if r.RequestURI != "/" { //打印非建立链接的日志
|
|
|
|
+ g.Log().Infof(r.Context(), "status:%d time:%fs req:%s waitPool:%fs level:%d from:%s query:%s", r.Response.Status, time.Since(now).Seconds(), r.RequestURI, r.GetCtxVar(consts.QueryWaitPoolTime).Float64(), queryLevel, r.GetClientIp(), string(bodyBytes))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
var (
|
|
var (
|