You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/20 05:57:26 UTC

[GitHub] [apisix] jagerzhang commented on issue #5998: request help: logger plugins supports report custom labels of route

jagerzhang commented on issue #5998:
URL: https://github.com/apache/apisix/issues/5998#issuecomment-1017145182


   > #5941 just privode `register_var` function, not implemented in the logger plugin code?
   
   确实没有在日志插件中实现,我参考这个写法自己试了下,发现`ctx.matched_route.value`里面并没有labels相关内容,代码如下:
   ```
       local route = ctx.matched_route and ctx.matched_route.value
       core.log.info("route.value: ", core.json.delay_encode(route))  # 这里输出我看了下,里面是没有路由自定义标签的。
       if route and route.labels then
           entry.route = {}
           entry.route.labels = route.labels
       end
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org