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 2020/11/11 07:58:30 UTC

[GitHub] [apisix] Miss-you edited a comment on issue #2643: request help: Use ngx.var.request_id as unique id for requests and response tracing, not jit-uuid.

Miss-you edited a comment on issue #2643:
URL: https://github.com/apache/apisix/issues/2643#issuecomment-725267485


   we can simply use `api_ctx.var.request_id`
   
   demo code:
   ```
   ngx.log(ngx.ERR, "access request_id:"..tostring(api_ctx.var.request_id))
   ngx.log(ngx.ERR, "access request_id:"..tostring(api_ctx.var.request_id))
   ```
   
   log:
   ``` 
   2020/11/11 15:57:22 [error] 4361#4978301: *1300 [lua] init.lua:339: http_access_phase(): access request_id:da75e5aed5dbd7b6cfe99fd773ea71e9, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", host: "localhost:9080"
   2020/11/11 15:57:22 [error] 4361#4978301: *1300 [lua] init.lua:340: http_access_phase(): access request_id:da75e5aed5dbd7b6cfe99fd773ea71e9, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", host: "localhost:9080"
   ```
   
   ![image](https://user-images.githubusercontent.com/3816205/98784853-adf0b780-2436-11eb-9d6c-29fc318d84d0.png)
   


----------------------------------------------------------------
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.

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