[VOL-3142] Enabled tracing for rw-core and added config parameters
Change-Id: I0c5faa104f35b2af694f32785ec031c5277e3f64
diff --git a/rw_core/main.go b/rw_core/main.go
index 19de6f0..98d3985 100644
--- a/rw_core/main.go
+++ b/rw_core/main.go
@@ -106,8 +106,6 @@
// Update all loggers to log level specified as input parameter
log.SetAllLogLevel(logLevel)
- //log.SetPackageLogLevel("github.com/opencord/voltha-go/rw_core/core", log.DebugLevel)
-
defer func() {
err := log.CleanUp()
if err != nil {
@@ -143,6 +141,13 @@
// Add the probe to the context to pass to all the services started
probeCtx := context.WithValue(ctx, probe.ProbeContextKey, p)
+ closer, err := log.InitTracingAndLogCorrelation(cf.TraceEnabled, cf.TraceAgentAddress, cf.LogCorrelationEnabled)
+ if err != nil {
+ logger.Warnw(ctx, "unable-to-initialize-tracing-and-log-correlation-module", log.Fields{"error": err})
+ } else {
+ defer closer.Close()
+ }
+
// create and start the core
core := c.NewCore(probeCtx, instanceID, cf)