From 3d7a4d61bcc22327518093ea95b35d24e7a44bef Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Wed, 8 Dec 2021 17:50:47 +0200 Subject: [PATCH] fix(init-logger): init logger for react-load example (#764) Co-authored-by: Naseem <24660299+naseemkullah@users.noreply.github.com> --- examples/react-load/react/src/web-tracer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/react-load/react/src/web-tracer.js b/examples/react-load/react/src/web-tracer.js index 984374bfbe..9a09d6dfad 100644 --- a/examples/react-load/react/src/web-tracer.js +++ b/examples/react-load/react/src/web-tracer.js @@ -3,6 +3,7 @@ import { WebTracerProvider } from '@opentelemetry/sdk-trace-web'; import { BaseOpenTelemetryComponent } from '@opentelemetry/plugin-react-load'; import { ZoneContextManager } from '@opentelemetry/context-zone'; import { CollectorTraceExporter } from '@opentelemetry/exporter-collector'; +import { diag, DiagConsoleLogger } from '@opentelemetry/api'; export default (serviceName) => { const provider = new WebTracerProvider(); @@ -21,7 +22,7 @@ export default (serviceName) => { const tracer = provider.getTracer(serviceName); BaseOpenTelemetryComponent.setTracer(serviceName) - BaseOpenTelemetryComponent.setLogger(provider.logger) + diag.setLogger(new DiagConsoleLogger()); return tracer; }