membphis commented on a change in pull request #1414:
URL: https://github.com/apache/incubator-apisix/pull/1414#discussion_r417045429



##########
File path: apisix/plugins/syslog.lua
##########
@@ -63,23 +68,26 @@ function _M.log(conf)
         return
     end
 
-    local logger, err = logger_socket:new({
-        host = conf.host,
-        port = conf.port,
-        flush_limit = conf.flush_limit,
-        drop_limit = conf.drop_limit,
-        timeout = conf.timeout,
-        sock_type = conf.sock_type,
-        max_retry_times = conf.max_retry_times,
-        retry_interval = conf.retry_interval,
-        pool_size = conf.pool_size,
-        tls = conf.tls,
-    })
+    -- fetch it from lrucache
+    local logger, err =  lrucache("127.0.0.1", "29999",

Review comment:
       We can use `api_ctx.conf_type .. "#" .. api_ctx.conf_id` as key, 
`api_ctx.conf_version` as version for this lrucache use case.
   
   `local logger, err =  lrucache("127.0.0.1", "29999",`
   to
   `local logger, err =  lrucache(api_ctx.conf_type .. "#" .. api_ctx.conf_id, 
api_ctx.conf_version, ...`
   
   Here is an example: 
https://github.com/apache/incubator-apisix/blob/master/apisix/core/lrucache.lua#L199




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


Reply via email to