dcsunny 4 năm trước cách đây
mục cha
commit
bd1866fb10
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      http/middleware/logging/logging.go

+ 5 - 1
http/middleware/logging/logging.go

@@ -58,7 +58,11 @@ func Server(opts ...Option) middleware.Middleware {
 				params = req.(fmt.Stringer).String()
 			}
 			fromPath := param.GetFromPath(ctx)
-			ctx = context2.AppendToContext(ctx, "from_path", fromPath+"|"+path)
+			if fromPath != "" {
+				ctx = context2.AppendToContext(ctx, "from_path", fromPath+"|"+path)
+			} else {
+				ctx = context2.AppendToContext(ctx, "from_path", path)
+			}
 			reply, err := handler(ctx, req)
 			if err != nil {
 				log.Errorw(