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/09 06:49:00 UTC

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

membphis opened a new issue #2196:
URL: https://github.com/apache/apisix/issues/2196


   https://github.com/apache/apisix/blob/master/apisix/utils/log-util.lua#L67
   
   The file name is not enough.
   we need to read the file content.


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



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

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007215413


   Would it be better to adjust the parameters to avoid the request being logged in the file?


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



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

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007217778


   > Would it be better to adjust the parameters to avoid the request being logged in the file?
   
   There has a trade-off between the memory usage and the disk operations, but it should be decided by the user.


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



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

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007167526


   I don't think it is a good idea. As the disk operation is expensive and it only happens when the body is too large. Reading truncated body is not so helpful in the log.


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



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

Posted by GitBox <gi...@apache.org>.
swayamraina commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-689745070


   Hi @membphis 
   I would like to pick this up. Can you describe what exactly is required here?


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



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

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007215413


   Would it be better to adjust the parameters to avoid the request being logged in the file?


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



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

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007328999


   Hope to hear more users' voices.


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



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

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-690036238


   @swayamraina I have assigned this issue to you, many thx


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



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

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007150933


   > @membphis Is this feature still required?
   
   yes, we need this feature. 


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



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

Posted by GitBox <gi...@apache.org>.
swayamraina commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-691269807






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



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

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007217778


   > Would it be better to adjust the parameters to avoid the request being logged in the file?
   
   There has a trade-off between the memory usage and the disk operations, but it should be decided by the user.


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



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

Posted by GitBox <gi...@apache.org>.
swayamraina commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-691269807






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



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

Posted by GitBox <gi...@apache.org>.
swayamraina commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-691269807


   @membphis  I got what exactly is required here and will raise a PR.
   I had one question though, why would request body data get cached to a local file and be absent in the request body


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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
sshniro commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-703123070


   @membphis any idea how to create this scenario? Where the body is kept in a local file? Does it occur if the data is too big?


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



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

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007328999


   Hope to hear more users' voices.


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



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

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-1007143442


   @membphis 
   Is this feature still required?


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



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

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2196:
URL: https://github.com/apache/apisix/issues/2196#issuecomment-703340989


   > Does it occur if the data is too big?
   
   you are right. for more detail information, you can take a look at: https://github.com/openresty/lua-nginx-module#ngxreqread_body
   
   I think that if the request body is big, we can only read the first 1 MB of the request body data.


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