zhendongcmss commented on a change in pull request #6256:
URL: https://github.com/apache/apisix/pull/6256#discussion_r808693582



##########
File path: apisix/plugins/error-log-logger.lua
##########
@@ -214,6 +227,78 @@ local function send_to_skywalking(log_message)
 end
 
 
+local function send_to_clickhouse(log_message)
+    local err_msg
+    local res = true
+    local url_decoded = url.parse(config.clickhouse.endpoint_addr)
+    local host = url_decoded.host
+    local port = url_decoded.port
+    core.log.info("sending a batch logs to ", config.clickhouse.endpoint_addr)
+
+    if not port then
+        if url_decoded.scheme == "https" then
+            port = 443
+        else
+            port = 80
+        end
+    end
+
+    local httpc = http.new()
+    httpc:set_timeout(config.timeout * 1000)
+    local ok, err = httpc:connect(host, port)
+    if not ok then
+        return false, "failed to connect to host[" .. host .. "] port["
+            .. tostring(port) .. "] " .. err
+    end
+
+    if url_decoded.scheme == "https" then

Review comment:
       There need add a ssl_verify ?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to