...
|
...
|
@@ -99,13 +99,13 @@ func InspectRoleAccess(parentObject string, skipUrl ...string) func(*context.Con |
|
|
}
|
|
|
}
|
|
|
|
|
|
func CreateRequstLogFilter() func(ctx *context.Context) {
|
|
|
func CreateRequestLogFilter() func(ctx *context.Context) {
|
|
|
return func(ctx *context.Context) {
|
|
|
requestId := fmt.Sprintf("%v.%v.%v ", ctx.Input.Method(), ctx.Input.URI(), time.Now().UnixNano())
|
|
|
ctx.Request.Header.Add("requestId", requestId)
|
|
|
var body string = "{}"
|
|
|
if ctx.Input.GetData("requestBody") != nil {
|
|
|
body = string(ctx.Input.GetData("requestBody").([]byte))
|
|
|
if len(ctx.Input.RequestBody) > 0 {
|
|
|
body = string(ctx.Input.RequestBody)
|
|
|
}
|
|
|
log.Debug(fmt.Sprintf("====>Recv RequestId:%s \nBodyData:%s", requestId, body))
|
|
|
}
|
...
|
...
|
@@ -118,7 +118,7 @@ func CreateResponseLogFilter() func(ctx *context.Context) { |
|
|
if len(body) > 1000 {
|
|
|
body = body[:1000]
|
|
|
}
|
|
|
log.Debug(fmt.Sprintf("<====Send User:%v RequestId:%v BodyData:%s", ctx.Input.GetData("x-mmm-id"), requestId, body))
|
|
|
log.Debug(fmt.Sprintf("<====Send User:%v RequestId:%v \nResponseData:%s", ctx.Input.GetData("x-mmm-id"), requestId, body))
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|