mirror of
https://github.com/potats0/lua-resty-coraza.git
synced 2025-06-28 17:41:00 +03:00
feat:添加 process_logging函数
This commit is contained in:
parent
cbde5767f1
commit
0f1196d55f
@ -132,6 +132,7 @@ function _M.do_body_filter()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function _M.do_log()
|
function _M.do_log()
|
||||||
|
coraza.process_logging()
|
||||||
local msg = coraza.get_matched_logmsg(ngx_ctx.transaction)
|
local msg = coraza.get_matched_logmsg(ngx_ctx.transaction)
|
||||||
ngx_ctx.coraza_msg = msg
|
ngx_ctx.coraza_msg = msg
|
||||||
|
|
||||||
|
@ -329,9 +329,17 @@ end
|
|||||||
|
|
||||||
function _M.get_matched_logmsg(transaction)
|
function _M.get_matched_logmsg(transaction)
|
||||||
local c_str = coraza.coraza_get_matched_logmsg(transaction)
|
local c_str = coraza.coraza_get_matched_logmsg(transaction)
|
||||||
|
nlog(debug_fmt("Transaction %s uccess to invoke coraza_get_matched_logmsg",
|
||||||
|
ngx_ctx.request_id))
|
||||||
local res = ffi.string(c_str)
|
local res = ffi.string(c_str)
|
||||||
coraza.coraza_free_matched_logmsg(c_str)
|
coraza.coraza_free_matched_logmsg(c_str)
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _M.process_logging(transaction)
|
||||||
|
coraza.coraza_process_logging(transaction)
|
||||||
|
nlog(debug_fmt("Transaction %s uccess to invoke coraza_process_logging",
|
||||||
|
ngx_ctx.request_id))
|
||||||
|
end
|
||||||
|
|
||||||
return _M
|
return _M
|
Loading…
x
Reference in New Issue
Block a user