I have enabled my custom plugin successfully, but I have no way to know whether it is executed it no not.
my plugin is enabled globally
the access method of the handler should execute when a request received , but even though I add a none existed method breakhere, no error happened.
handler.lua
function ApiStats:access(conf)
breakhere()
ApiStats.super.log(self)
local ok, err = buffer.init({
host = conf.host,
port = conf.port,
proto = conf.proto,
db = conf.db,
auth = conf.username and conf.password and conf.username.. ":" ..conf.password or Nil
})
if (not ok) then
ngx.log(ngx.ERR, err)
return false
end
ApiStats.setupFlushHandler()
local point = influxdb_point(ngx, conf)
buffer.buffer(point)
return true, point
end