You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/BuffLog/BuffLog.php
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -103,15 +103,21 @@ private static function enrichLog()
103
103
// );
104
104
105
105
try {
106
+
107
+
if (class_exists("\DDTrace\GlobalTracer", false) === false) {
108
+
thrownew \Exception('DDTrace\GlobalTracer can\'t be found. Have you setup the Datadog Tracer extension? If you run cli worker, have you added the DD_TRACE_CLI_ENABLED env variable?');
109
+
}
110
+
106
111
// Add traces information to be able to correlate logs with APM
error_log($e->getMessage() . " Can't add trace to logs. Have you setup the Datadog Tracer extension? If you run a worker have your added the DD_TRACE_CLI_ENABLED env variable?");
118
+
} catch (\Exception$e) {
119
+
// we probably will want to make an no-op or it will be too verbose
120
+
error_log($e->getMessage() . " Traces will not be added in the logs");
0 commit comments