Browse Source

fix a bug with the periodic_flush param

pull/1/head
Nicolas Massé 8 years ago
parent
commit
1afc6d0cfc
  1. 14
      verbose.lua

14
verbose.lua

@ -55,14 +55,22 @@ end
function _M:init_worker() function _M:init_worker()
ngx.log(ngx.INFO, "Initializing the underlying logger") ngx.log(ngx.INFO, "Initializing the underlying logger")
if not logger.initted() then if not logger.initted() then
local ok, err = logger.init{ -- default parameters
local params = {
host = host, host = host,
port = port, port = port,
sock_type = proto, sock_type = proto,
flush_limit = flush_limit, flush_limit = flush_limit,
drop_limit = drop_limit, drop_limit = drop_limit
periodic_flush = periodic_flush
} }
-- periodic_flush == 0 means 'disable this feature'
if periodic_flush > 0 then
params["periodic_flush"] = periodic_flush
end
-- initialize the logger
local ok, err = logger.init(params)
if not ok then if not ok then
ngx.log(ngx.ERR, "failed to initialize the logger: ", err) ngx.log(ngx.ERR, "failed to initialize the logger: ", err)
end end

Loading…
Cancel
Save