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/05/06 09:26:43 UTC

[GitHub] [incubator-apisix] spacewander commented on a change in pull request #1545: Option to include request body in log util

spacewander commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-apisix/pull/1545#discussion_r420656682



##########
File path: apisix/utils/log-util.lua
##########
@@ -56,6 +56,12 @@ local function get_full_log(ngx)
         start_time = ngx.req.start_time() * 1000,
         latency = (ngx.now() - ngx.req.start_time()) * 1000
     }
+
+    if conf.include_req_body then
+        log.request.body = ngx.req.get_body_data()

Review comment:
       Should we distinguish `without body` (like `GET` request) from `body too big` (like `get_body_data()` returns `nil` but `get_body_file()` doesn't)?




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