diff --git a/lib/resty/coraza.lua b/lib/resty/coraza.lua index 53c3844..aa037dd 100644 --- a/lib/resty/coraza.lua +++ b/lib/resty/coraza.lua @@ -132,6 +132,7 @@ function _M.do_body_filter() end function _M.do_log() + coraza.process_logging() local msg = coraza.get_matched_logmsg(ngx_ctx.transaction) ngx_ctx.coraza_msg = msg diff --git a/lib/resty/coraza/coraza.lua b/lib/resty/coraza/coraza.lua index 7949eb0..cd4b774 100644 --- a/lib/resty/coraza/coraza.lua +++ b/lib/resty/coraza/coraza.lua @@ -329,9 +329,17 @@ end function _M.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) coraza.coraza_free_matched_logmsg(c_str) return res 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 \ No newline at end of file