Skip to content

Commit

Permalink
fix(init-logger): init logger for react-load example (open-telemetry#764
Browse files Browse the repository at this point in the history
)

Co-authored-by: Naseem <[email protected]>
  • Loading branch information
nemoshlag and naseemkullah authored Dec 8, 2021
1 parent 56d332e commit 3d7a4d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/react-load/react/src/web-tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}

0 comments on commit 3d7a4d6

Please sign in to comment.