Skip to content

Commit 691bd73

Browse files
committed
provide more information on possible traces ability
1 parent 45ac756 commit 691bd73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/BuffLog/BuffLog.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ static public function getLogger()
3636

3737
protected static function configureInstance()
3838
{
39+
40+
if (!class_exists("\DDTrace\GlobalTracer")) {
41+
error_log("Tip #1: Can't find \DDTrace\GlobalTracer class. Did you install the Datadog APM tracer extension? It will allow you to have logs enriched with traces making troubleshooting easier! :)");
42+
error_log("Tip #2: If you run a cli mode service (such as a worker), did you set the DD_TRACE_CLI_ENABLED env variable?");
43+
}
44+
3945
// @TODO: We could potentially use the Kubernetes downward API to
4046
// define the logger name. This will make it easier for developers
4147
// to read and friendlier to identify where come the logs at a glance
@@ -105,7 +111,7 @@ private static function enrichLog()
105111
];
106112

107113
} catch (Exception $e) {
108-
error_log($e->getMessage() . " If you run a cli mode service (such as a worker), did you set the DD_TRACE_CLI_ENABLED env variable?");
114+
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?");
109115
}
110116

111117
return $record;

0 commit comments

Comments
 (0)