From 361f30796cb51918a24580ebcdddc0a215e5003b Mon Sep 17 00:00:00 2001 From: Alejandro Estringana Ruiz Date: Thu, 20 Feb 2025 17:23:22 +0100 Subject: [PATCH] Add format to logging messages --- appsec/src/extension/backtrace.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/appsec/src/extension/backtrace.c b/appsec/src/extension/backtrace.c index 9d8b3799b6..3929e4240b 100644 --- a/appsec/src/extension/backtrace.c +++ b/appsec/src/extension/backtrace.c @@ -245,7 +245,9 @@ bool dd_report_exploit_backtrace(zend_string *nullable id) array_init(meta_struct); } else if (Z_TYPE_P(meta_struct) != IS_ARRAY) { if (!get_global_DD_APPSEC_TESTING()) { - mlog(dd_log_trace, "Field meta_struct is not an array"); + mlog(dd_log_trace, + "Field 'meta_struct' is of type '%d', expected 'array'", + Z_TYPE_P(meta_struct)); } return false; } @@ -262,7 +264,9 @@ bool dd_report_exploit_backtrace(zend_string *nullable id) mlog(dd_log_trace, "Backtrace stack created"); } else if (Z_TYPE_P(dd_stack) != IS_ARRAY) { if (!get_global_DD_APPSEC_TESTING()) { - mlog(dd_log_trace, "Field stack is not an array"); + mlog(dd_log_trace, + "Field 'stack' is of type '%d', expected 'array'", + Z_TYPE_P(dd_stack)); } return false; } else { @@ -270,7 +274,8 @@ bool dd_report_exploit_backtrace(zend_string *nullable id) } if (Z_TYPE_P(exploit) != IS_ARRAY) { - mlog(dd_log_trace, "Field exploit is not an array"); + mlog(dd_log_trace, "Field 'exploit' is of type '%d', expected 'array'", + Z_TYPE_P(exploit)); return false; }