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 2021/11/19 01:27:39 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #5550: feat: support to log response body

spacewander commented on a change in pull request #5550:
URL: https://github.com/apache/apisix/pull/5550#discussion_r752796481



##########
File path: apisix/plugins/http-logger.lua
##########
@@ -44,6 +44,7 @@ local schema = {
         inactive_timeout = {type = "integer", minimum = 1, default = 5},
         batch_max_size = {type = "integer", minimum = 1, default = 1000},
         include_req_body = {type = "boolean", default = false},
+        include_resp_body = {type = "boolean", default = false},

Review comment:
       It would be better to use `include_resp_body_expr` to include the response body dynamically. We can eval it in the header_filter.

##########
File path: apisix/plugins/http-logger.lua
##########
@@ -162,6 +163,17 @@ local function remove_stale_objects(premature)
 end
 
 
+function _M.body_filter(conf, ctx)
+    if conf.include_resp_body then

Review comment:
       Let's refactor this part into a method in log-util.




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