log info when endpoints change for a balancer

This commit is contained in:
Elvin Efendi 2019-05-25 23:50:18 -04:00
parent dfa7f10fc9
commit dc7fa885a2
3 changed files with 18 additions and 0 deletions

View file

@ -4,6 +4,10 @@ local util = require("util")
local ck = require("resty.cookie")
local math = require("math")
local string_format = string.format
local ngx_log = ngx.log
local INFO = ngx.INFO
local _M = balancer_resty:new({ factory = resty_chash, name = "sticky" })
local DEFAULT_COOKIE_NAME = "route"
@ -98,6 +102,8 @@ function _M.sync(self, backend)
return
end
ngx_log(INFO, string_format("[%s] nodes have changed for backend %s", self.name, backend.name))
self.cookie_session_affinity = backend.sessionAffinityConfig.cookieSessionAffinity
end