diff --git a/ext/hook/uhook.c b/ext/hook/uhook.c index b1fa8f81e1..bfda0b32cd 100644 --- a/ext/hook/uhook.c +++ b/ext/hook/uhook.c @@ -217,8 +217,8 @@ void dd_uhook_report_sandbox_error(zend_execute_data *execute_data, zend_object log("%s thrown in ddtrace's closure defined at %s:%d for %s%s%s(): %s in %s on line %d", type, deffile, defline, scope, colon, name, msg, regular_exception ? ZSTR_VAL(exfile) : "Unknown", exline); if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED()) { - INTEGRATION_ERROR_TELEMETRY(ERROR, "%s thrown in ddtrace's closure defined at %s:%d for %s%s%s(): %s in %s on line %d", - type, ddtrace_telemetry_redact_file(deffile), defline, scope, colon, name, msg, regular_exception ? ddtrace_telemetry_redact_file(ZSTR_VAL(exfile)) : "Unknown", exline); + INTEGRATION_ERROR_TELEMETRY(ERROR, "%s thrown in ddtrace's closure defined at %s:%d for %s%s%s(): $ERROR_MSG in %s on line %d", + type, ddtrace_telemetry_redact_file(deffile), defline, scope, colon, name, regular_exception ? ddtrace_telemetry_redact_file(ZSTR_VAL(exfile)) : "Unknown", exline); } if (exfile) { zend_string_release(exfile); @@ -227,8 +227,8 @@ void dd_uhook_report_sandbox_error(zend_execute_data *execute_data, zend_object log("Error raised in ddtrace's closure defined at %s:%d for %s%s%s(): %s in %s on line %d", deffile, defline, scope, colon, name, LAST_ERROR_STRING, LAST_ERROR_FILE, PG(last_error_lineno)); if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED()) { - INTEGRATION_ERROR_TELEMETRY(ERROR, "Error raised in ddtrace's closure defined at %s:%d for %s%s%s(): %s in %s on line %d", - ddtrace_telemetry_redact_file(deffile), defline, scope, colon, name, LAST_ERROR_STRING, ddtrace_telemetry_redact_file(LAST_ERROR_FILE), PG(last_error_lineno)); + INTEGRATION_ERROR_TELEMETRY(ERROR, "Error raised in ddtrace's closure defined at %s:%d for %s%s%s(): $ERROR_MSG in %s on line %d", + ddtrace_telemetry_redact_file(deffile), defline, scope, colon, name, ddtrace_telemetry_redact_file(LAST_ERROR_FILE), PG(last_error_lineno)); } } }) diff --git a/tests/ext/telemetry/integration_runtime_error.phpt b/tests/ext/telemetry/integration_runtime_error.phpt index 3ece2c3dc6..8aa28dab6f 100644 --- a/tests/ext/telemetry/integration_runtime_error.phpt +++ b/tests/ext/telemetry/integration_runtime_error.phpt @@ -68,7 +68,7 @@ array(2) { [0]=> array(7) { ["message"]=> - string(165) "Error raised in ddtrace's closure defined at %cintegration_runtime_error.php:12 for foo(): Testnotice in %cintegration_runtime_error.php on line 13" + string(165) "Error raised in ddtrace's closure defined at %cintegration_runtime_error.php:12 for foo(): $ERROR_MSG in %cintegration_runtime_error.php on line 13" ["level"]=> string(5) "ERROR" ["count"]=> @@ -85,7 +85,7 @@ array(2) { [1]=> array(7) { ["message"]=> - string(161) "Exception thrown in ddtrace's closure defined at %cintegration_runtime_error.php:7 for foo(): test in %cintegration_runtime_error.php on line %d" + string(167) "Exception thrown in ddtrace's closure defined at %cintegration_runtime_error.php:7 for foo(): $ERROR_MSG in %cintegration_runtime_error.php on line %d" ["level"]=> string(5) "ERROR" ["count"]=>