mirror of
https://github.com/potats0/lua-resty-coraza.git
synced 2025-06-28 17:41:00 +03:00
feat: add process_logging
This commit is contained in:
parent
0ef7a2a9e3
commit
2e848479e8
@ -69,6 +69,7 @@ location /t {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log_by_lua_block{
|
log_by_lua_block{
|
||||||
|
coraza.do_log()
|
||||||
coraza.do_free_transaction()
|
coraza.do_free_transaction()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ local err_fmt = log.err_fmt
|
|||||||
local warn_fmt = log.warn_fmt
|
local warn_fmt = log.warn_fmt
|
||||||
|
|
||||||
local _M = {
|
local _M = {
|
||||||
_VERSION = '1.0.0-rc2'
|
_VERSION = '1.0.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
function _M.create_waf()
|
function _M.create_waf()
|
||||||
@ -118,4 +118,8 @@ function _M.do_body_filter()
|
|||||||
response.build_and_process_body(ngx.ctx.transaction)
|
response.build_and_process_body(ngx.ctx.transaction)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _M.do_log()
|
||||||
|
coraza.process_logging(ngx.ctx.transaction)
|
||||||
|
end
|
||||||
|
|
||||||
return _M
|
return _M
|
||||||
|
@ -327,4 +327,13 @@ function _M.process_response_body(transaction)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _M.process_logging(transaction)
|
||||||
|
local ok, msg = pcall(coraza.coraza_process_logging, transaction)
|
||||||
|
if ok then
|
||||||
|
nlog(debug_fmt("success to invoke coraza_process_logging"))
|
||||||
|
else
|
||||||
|
nlog(debug_fmt("failed to invoke coraza_process_logging. msg: %s", msg))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return _M
|
return _M
|
Loading…
x
Reference in New Issue
Block a user