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/24 15:56:12 UTC

[GitHub] [apisix] membphis opened a new pull request #2309: feat(http-logger): support for specified the log formats via admin API

membphis opened a new pull request #2309:
URL: https://github.com/apache/apisix/pull/2309


   This reverts commit 13b09683400e41529258fe21f013668880a6a5ba.
   
   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   related PR: https://github.com/apache/apisix/pull/2307
   
   let us discuss it in this PR.
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible?
   


----------------------------------------------------------------
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] spacewander commented on a change in pull request #2309: feat(http-logger): support for specified the log formats via admin API

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #2309:
URL: https://github.com/apache/apisix/pull/2309#discussion_r503644982



##########
File path: apisix/plugins/http-logger.lua
##########
@@ -117,12 +139,52 @@ local function send_http_data(conf, log_message)
 end
 
 
-function _M.log(conf)
-    local entry = log_util.get_full_log(ngx, conf)
+local function gen_log_format(metadata)
+    local log_format = {}
+    if metadata == nil then
+        return log_format
+    end
+
+    for k, var_name in pairs(metadata.value.log_format) do
+        if var_name:sub(1, 1) == "$" then

Review comment:
       `var_name:byte(1, 1)` is already enough?




----------------------------------------------------------------
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 a change in pull request #2309: feat(http-logger): support for specified the log formats via admin API

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #2309:
URL: https://github.com/apache/apisix/pull/2309#discussion_r503667225



##########
File path: apisix/plugins/http-logger.lua
##########
@@ -117,12 +139,52 @@ local function send_http_data(conf, log_message)
 end
 
 
-function _M.log(conf)
-    local entry = log_util.get_full_log(ngx, conf)
+local function gen_log_format(metadata)
+    local log_format = {}
+    if metadata == nil then
+        return log_format
+    end
+
+    for k, var_name in pairs(metadata.value.log_format) do
+        if var_name:sub(1, 1) == "$" then

Review comment:
       thx, fixed




----------------------------------------------------------------
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] spacewander merged pull request #2309: feat(http-logger): support for specified the log formats via admin API

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #2309:
URL: https://github.com/apache/apisix/pull/2309


   


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