Skip to content

Commit

Permalink
Change logging messages level
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana committed Feb 20, 2025
1 parent 9287f24 commit 702bec6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions appsec/src/extension/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static PHP_FUNCTION(datadog_appsec_testing_generate_backtrace)

bool dd_report_exploit_backtrace(zend_string *nullable id)
{
mlog(dd_log_debug, "Generating backtrace");
mlog(dd_log_trace, "Generating backtrace");
if (!get_global_DD_APPSEC_STACK_TRACE_ENABLED()) {
mlog(dd_log_debug, "Backtrace generation is disabled with "
"DD_APPSEC_STACK_TRACE_ENABLED");
Expand All @@ -236,7 +236,7 @@ bool dd_report_exploit_backtrace(zend_string *nullable id)
zval *meta_struct = dd_trace_span_get_meta_struct(span);
if (!meta_struct) {
if (!get_global_DD_APPSEC_TESTING()) {
mlog(dd_log_warning, "Failed to retrieve root span meta_struct");
mlog(dd_log_trace, "Failed to retrieve root span meta_struct");
}
return false;
}
Expand All @@ -245,7 +245,7 @@ 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_warning, "Field meta_struct is not an array");
mlog(dd_log_trace, "Field meta_struct is not an array");
}
return false;
}
Expand All @@ -259,18 +259,18 @@ bool dd_report_exploit_backtrace(zend_string *nullable id)
exploit = zend_hash_add_new(
Z_ARR_P(dd_stack), _exploit_key, &EG(uninitialized_zval));
array_init(exploit);
mlog(dd_log_debug, "Backtrace stack created");
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_warning, "Field stack is not an array");
mlog(dd_log_trace, "Field stack is not an array");
}
return false;
} else {
exploit = zend_hash_find(Z_ARR_P(dd_stack), _exploit_key);
}

if (Z_TYPE_P(exploit) != IS_ARRAY) {
mlog(dd_log_debug, "Field exploit is not an array");
mlog(dd_log_trace, "Field exploit is not an array");
return false;
}

Expand All @@ -294,7 +294,7 @@ bool dd_report_exploit_backtrace(zend_string *nullable id)
return false;
}

mlog(dd_log_debug, "Stacktrace generated");
mlog(dd_log_trace, "Stacktrace generated");
return true;
}

Expand Down

0 comments on commit 702bec6

Please sign in to comment.