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/09/10 07:06:59 UTC

[GitHub] [apisix] membphis commented on issue #2196: feature(kafka-logger): need to read the request body data if it was cached to local file

membphis commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-690036027


   https://github.com/apache/apisix/blob/master/apisix/utils/log-util.lua#L67
   
   ```lua
   local body_file = ngx.req.get_body_file()
   if body_file then
       -- we only readed the file name of request body, it is not enough.
       -- we need to read the file content by file name.
       log.request.body_file = body_file
   end
   ```
   
   for how to read file content by file name, you can take a look at this: https://stackoverflow.com/questions/11201262/how-to-read-data-from-a-file-in-lua


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