diff --git a/pkg/flows/common.go b/pkg/flows/common.go
new file mode 100644
index 0000000..de85acf
--- /dev/null
+++ b/pkg/flows/common.go
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package flows
+
+import (
+	"github.com/opencord/voltha-lib-go/v2/pkg/log"
+)
+
+const (
+	logLevel = log.ErrorLevel
+)
+
+var logger log.Logger
+
+func init() {
+	// Setup this package so that it's log level can be modified at run time
+	var err error
+	logger, err = log.AddPackage(log.JSON, logLevel, log.Fields{"pkg": "flowsUtils"})
+	if err != nil {
+		panic(err)
+	}
+}
diff --git a/pkg/flows/flow_utils.go b/pkg/flows/flow_utils.go
index 02a4b0b..d3cf74d 100644
--- a/pkg/flows/flow_utils.go
+++ b/pkg/flows/flow_utils.go
@@ -510,7 +510,7 @@
 			return uint32(field.GetTableMetadata() & 0xFFFFFFFF)
 		}
 	}
-	log.Debug("No-metadata-present")
+	logger.Debug("No-metadata-present")
 	return 0
 }
 
@@ -523,7 +523,7 @@
 			return field.GetTableMetadata()
 		}
 	}
-	log.Debug("No-metadata-present")
+	logger.Debug("No-metadata-present")
 	return 0
 }
 
@@ -538,7 +538,7 @@
 			}
 		}
 	}
-	log.Debugw("No-write-metadata-present", log.Fields{"flow": flow})
+	logger.Debugw("No-write-metadata-present", log.Fields{"flow": flow})
 	return 0
 }
 
@@ -552,10 +552,10 @@
 	   This is set in the ONOS OltPipeline as a write metadata instruction
 	*/
 	var tpId uint16 = 0
-	log.Debugw("Write metadata value for Techprofile ID", log.Fields{"metadata": metadata})
+	logger.Debugw("Write metadata value for Techprofile ID", log.Fields{"metadata": metadata})
 	if metadata != 0 {
 		tpId = uint16((metadata >> 32) & 0xFFFF)
-		log.Debugw("Found techprofile ID from write metadata action", log.Fields{"tpid": tpId})
+		logger.Debugw("Found techprofile ID from write metadata action", log.Fields{"tpid": tpId})
 	}
 	return tpId
 }
@@ -570,10 +570,10 @@
 	*/
 	var uniPort uint32 = 0
 	md := GetMetadataFromWriteMetadataAction(flow)
-	log.Debugw("Metadata found for egress/uni port ", log.Fields{"metadata": md})
+	logger.Debugw("Metadata found for egress/uni port ", log.Fields{"metadata": md})
 	if md != 0 {
 		uniPort = uint32(md & 0xFFFFFFFF)
-		log.Debugw("Found EgressPort from write metadata action", log.Fields{"egress_port": uniPort})
+		logger.Debugw("Found EgressPort from write metadata action", log.Fields{"egress_port": uniPort})
 	}
 	return uniPort
 
@@ -591,7 +591,7 @@
 	md := GetMetadataFromWriteMetadataAction(flow)
 	if md != 0 {
 		innerTag = uint16((md >> 48) & 0xFFFF)
-		log.Debugw("Found  CVLAN from write metadate action", log.Fields{"c_vlan": innerTag})
+		logger.Debugw("Found  CVLAN from write metadate action", log.Fields{"c_vlan": innerTag})
 	}
 	return innerTag
 }
@@ -605,7 +605,7 @@
 		return 0
 	}
 	if md <= 0xffffffff {
-		log.Debugw("onos-upgrade-suggested", log.Fields{"Metadata_ofp": md, "message": "Legacy MetaData detected form OltPipeline"})
+		logger.Debugw("onos-upgrade-suggested", logger.Fields{"Metadata_ofp": md, "message": "Legacy MetaData detected form OltPipeline"})
 		return md
 	}
 	return (md >> 32) & 0xffffffff
@@ -730,7 +730,7 @@
 	meter := &ofp.OfpMeterEntry{Config: &ofp.OfpMeterConfig{},
 		Stats: &ofp.OfpMeterStats{BandStats: bandStats}}
 	if meterMod == nil {
-		log.Error("Invalid meter mod command")
+		logger.Error("Invalid meter mod command")
 		return meter
 	}
 	// config init
@@ -752,7 +752,7 @@
 		bandStats = append(bandStats, band)
 	}
 	meter.Stats.BandStats = bandStats
-	log.Debugw("Allocated meter entry", log.Fields{"meter": *meter})
+	logger.Debugw("Allocated meter entry", log.Fields{"meter": *meter})
 	return meter
 
 }
diff --git a/pkg/flows/flow_utils_test.go b/pkg/flows/flow_utils_test.go
index 8922a9c..a9dc9cc 100644
--- a/pkg/flows/flow_utils_test.go
+++ b/pkg/flows/flow_utils_test.go
@@ -17,7 +17,6 @@
 
 import (
 	"bytes"
-	"github.com/opencord/voltha-lib-go/v2/pkg/log"
 	ofp "github.com/opencord/voltha-protos/v2/go/openflow_13"
 	"github.com/stretchr/testify/assert"
 	"google.golang.org/grpc/codes"
@@ -32,7 +31,6 @@
 )
 
 func init() {
-	log.AddPackage(log.JSON, log.WarnLevel, nil)
 	timeoutError = status.Errorf(codes.Aborted, "timeout")
 	taskFailureError = status.Error(codes.Internal, "test failure task")
 	timeoutError = status.Errorf(codes.Aborted, "timeout")
