diff --git a/voltha-go-controller/onos_nbi/deviceconfig.go b/voltha-go-controller/onos_nbi/deviceconfig.go
index 709ba44..03e64bb 100644
--- a/voltha-go-controller/onos_nbi/deviceconfig.go
+++ b/voltha-go-controller/onos_nbi/deviceconfig.go
@@ -58,30 +58,32 @@
 	// Get the payload to process the request
 	d := new(bytes.Buffer)
 	if _, err := d.ReadFrom(r.Body); err != nil {
-		logger.Warnw(ctx, "Error reading buffer", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Error reading buffer", log.Fields{"Reason": err.Error()})
+		http.Error(w, err.Error(), http.StatusConflict)
 		return
 	}
 	// Unmarshal the request into device configuration structure
 	req := &app.DeviceConfig{}
 	if err := json.Unmarshal(d.Bytes(), req); err != nil {
-		logger.Warnw(ctx, "Unmarshal Failed", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Unmarshal Failed", log.Fields{"Reason": err.Error()})
 		http.Error(w, err.Error(), http.StatusConflict)
 		return
 	}
 	app.GetApplication().UpdateDeviceConfig(cntx, req)
+	logger.Debugw(ctx, "Added Device Config ", log.Fields{"Req": req})
 }
 
 func (oh *DeviceConfigHandle) FetchDeviceConfig(cntx context.Context, w http.ResponseWriter, r *http.Request) {
-	logger.Info(cntx, "Inside FetchDeviceConfig method")
 	vars := mux.Vars(r)
 	serialNum := vars["serialNumber"]
+	logger.Infow(cntx, "Inside FetchDeviceConfig method", log.Fields{"serialNum": serialNum})
 	deviceInfo := DeviceConfigPayload{}
 	dc := app.GetApplication().GetDeviceConfig(serialNum)
 	if dc != nil {
 		deviceInfo.DeviceConfig = dc
 		oltInfoJSON, err := json.Marshal(deviceInfo)
 		if err != nil {
-			logger.Errorw(ctx, "Failed to marshal olt payload response", log.Fields{"Error": err})
+			logger.Errorw(ctx, "Failed to marshal olt payload response", log.Fields{"deviceInfo": deviceInfo, "Error": err})
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
@@ -89,8 +91,9 @@
 		w.Header().Add("Content-Type", "application/json")
 		_, err = w.Write(oltInfoJSON)
 		if err != nil {
-			logger.Errorw(ctx, "Failed to write olt payload response", log.Fields{"Error": err})
+			logger.Errorw(ctx, "Failed to write olt payload response", log.Fields{"deviceInfo": deviceInfo, "Error": err})
 			w.WriteHeader(http.StatusInternalServerError)
+			return
 		}
 	} else {
 		logger.Warnw(ctx, "Device not found", log.Fields{"serialNum": serialNum})
diff --git a/voltha-go-controller/onos_nbi/deviceportadapter.go b/voltha-go-controller/onos_nbi/deviceportadapter.go
index c27737e..5feba61 100644
--- a/voltha-go-controller/onos_nbi/deviceportadapter.go
+++ b/voltha-go-controller/onos_nbi/deviceportadapter.go
@@ -63,7 +63,7 @@
 
 	deviceListJSON, err := json.Marshal(deviceListResp)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling device list response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling device list response", log.Fields{"DeviceListResp": deviceListResp, "Error": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -71,9 +71,11 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(deviceListJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending deviceList response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending deviceList response", log.Fields{"DeviceListResp": deviceListResp, "Error": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching Device List Resp", log.Fields{"DeviceListResp": deviceListResp})
 }
 
 // ServeHTTP to serve HTTP requests
@@ -106,6 +108,7 @@
 func (dh *DevicePortHandle) GetPortListPerDevice(w http.ResponseWriter, r *http.Request) {
 	vars := mux.Vars(r)
 	deviceID := vars["olt_of_id"]
+	logger.Infow(ctx, "Received Get Port List request for device", log.Fields{"deviceID": deviceID})
 
 	var devicePortListResp DevicePortEntry
 	devicePortListResp.Device = Device{}
@@ -118,17 +121,16 @@
 		return true
 	}
 	if len(deviceID) > 0 {
-		logger.Infow(ctx, "Received Port get request for device", log.Fields{"deviceID": deviceID})
 		voltDevice := app.GetApplication().GetDevice(deviceID)
 		if voltDevice != nil {
-			logger.Infow(ctx, "Found device", log.Fields{"deviceID": deviceID})
+			logger.Debugw(ctx, "Fetch volt device from voltApplication", log.Fields{"voltDevice": voltDevice})
 			devicePortListResp.Device = convertVoltDeviceToDevice(voltDevice)
 			voltDevice.Ports.Range(getPortList)
 		}
 	}
 	portListJSON, err := json.Marshal(devicePortListResp)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling port list response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling port list response", log.Fields{"DevicePortListResp": devicePortListResp, "Error": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -136,9 +138,11 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(portListJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending portList response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error in sending portList response", log.Fields{"DevicePortListResp": devicePortListResp, "Error": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching Port List for device", log.Fields{"devicePortListResp": devicePortListResp, "deviceID": deviceID})
 }
 
 // GetPortList to get device id list
@@ -146,6 +150,7 @@
 	va := app.GetApplication()
 	var portListResp PortEntry
 	portListResp.Ports = []Port{}
+	logger.Debug(ctx, "Received Get Port List")
 
 	getPortList := func(key, value interface{}) bool {
 		voltPort := value.(*app.VoltPort)
@@ -163,7 +168,7 @@
 
 	portListJSON, err := json.Marshal(portListResp)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling port list response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling port list response", log.Fields{"PortListResp": portListResp, "Error": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -171,7 +176,9 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(portListJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending portList response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending portList response", log.Fields{"PortListResp": portListResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching Port List ", log.Fields{"PortListResp": portListResp})
 }
diff --git a/voltha-go-controller/onos_nbi/dhcprelayadapter.go b/voltha-go-controller/onos_nbi/dhcprelayadapter.go
index 7c30351..172e4aa 100644
--- a/voltha-go-controller/onos_nbi/dhcprelayadapter.go
+++ b/voltha-go-controller/onos_nbi/dhcprelayadapter.go
@@ -60,16 +60,17 @@
 func (dh *DhcpRelayHandle) GetAllocations(cntx context.Context, w http.ResponseWriter, r *http.Request) {
 	vars := mux.Vars(r)
 	deviceID := vars[DeviceID]
+	logger.Debugw(ctx, "Received Get DhcpAllocation info for device ID", log.Fields{"deviceID": deviceID})
 	Allocations, err := app.GetApplication().GetAllocations(cntx, deviceID)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to get dhcp allocations", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to get dhcp allocations", log.Fields{"deviceID": deviceID, "Reason": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
 
 	AllocRespJSON, err := json.Marshal(Allocations)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to Marshal dhcp allocation response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Failed to Marshal dhcp allocation response", log.Fields{"Allocations": Allocations, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -77,7 +78,9 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(AllocRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to write dhcp allocations response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Failed to write dhcp allocations response", log.Fields{"Allocations": Allocations, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching DhcpAllocation info for device ID", log.Fields{"Allocations": Allocations, "deviceID": deviceID})
 }
diff --git a/voltha-go-controller/onos_nbi/flowadapter.go b/voltha-go-controller/onos_nbi/flowadapter.go
index 1861e05..b31700d 100644
--- a/voltha-go-controller/onos_nbi/flowadapter.go
+++ b/voltha-go-controller/onos_nbi/flowadapter.go
@@ -81,6 +81,8 @@
 }
 
 func (pfh *PendingFlowHandle) GetPendingFlows(cntx context.Context, w http.ResponseWriter, r *http.Request) {
+	logger.Debug(ctx, "Received Get Pending Flows request")
+
 	flows, err := cntlr.GetController().GetAllPendingFlows()
 	if err != nil {
 		logger.Errorw(ctx, "Failed to get Pending flows", log.Fields{"Error": err})
@@ -90,7 +92,7 @@
 	flowResp := ConvertFlowsToFlowEntry(flows)
 	FlowRespJSON, err := json.Marshal(flowResp)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to marshal pending flow response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Failed to marshal pending flow response", log.Fields{"Flows": flows, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -98,7 +100,7 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(FlowRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to write Pending Flow response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Failed to write Pending Flow response", log.Fields{"Flows": flows, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 	}
 }
@@ -107,12 +109,19 @@
 	vars := mux.Vars(r)
 	deviceID := vars["deviceId"]
 	flowIDStr := vars["flowId"]
-	flowID, _ := strconv.ParseUint(flowIDStr, 10, 64)
+	logger.Debugw(ctx, "Received Get Flows specific to flowID and deviceID", log.Fields{"flowId": flowIDStr, "DeviceID": deviceID})
+
+	flowID, parseErr := strconv.ParseUint(flowIDStr, 10, 64)
+	if parseErr != nil {
+		logger.Errorw(ctx, "Failed to parse flowIDStr from string to uint64", log.Fields{"flowIDStr": flowIDStr, "Reason": parseErr.Error()})
+		w.WriteHeader(http.StatusInternalServerError)
+		return
+	}
 	var flowResp FlowEntry
 	if len(deviceID) > 0 && len(flowIDStr) > 0 {
 		flow, err := fh.getFlow(deviceID, flowID)
 		if err != nil {
-			logger.Errorw(ctx, "Failed to Fetch flow", log.Fields{"Error": err})
+			logger.Errorw(ctx, "Failed to Fetch flow", log.Fields{"FlowID": flowID, "DeviceID": deviceID, "Error": err})
 			http.Error(w, err.Error(), http.StatusBadRequest)
 			return
 		}
@@ -121,7 +130,7 @@
 	} else {
 		flows, err := fh.getAllFlows(deviceID)
 		if err != nil {
-			logger.Errorw(ctx, "Failed to Fetch flows", log.Fields{"Error": err})
+			logger.Errorw(ctx, "Failed to Fetch flows", log.Fields{"DeviceID": deviceID, "Error": err})
 			http.Error(w, err.Error(), http.StatusBadRequest)
 			return
 		}
@@ -130,7 +139,7 @@
 	}
 	FlowRespJSON, err := json.Marshal(flowResp)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to marshal flow response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Failed to marshal flow response", log.Fields{"FlowID": flowID, "DeviceID": deviceID, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -138,9 +147,11 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(FlowRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to write flow response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Failed to write flow response", log.Fields{"FlowID": flowID, "DeviceID": deviceID, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Request for getting Flow specific to flowID and deviceID", log.Fields{"FlowID": flowID, "DeviceID": deviceID, "flowResp": flowResp})
 }
 
 func (fh *FlowHandle) getAllFlows(deviceID string) ([]*of.VoltSubFlow, error) {
diff --git a/voltha-go-controller/onos_nbi/groups.go b/voltha-go-controller/onos_nbi/groups.go
index 2280654..7fc738b 100644
--- a/voltha-go-controller/onos_nbi/groups.go
+++ b/voltha-go-controller/onos_nbi/groups.go
@@ -40,9 +40,9 @@
 
 // ServeHTTP to serve http request
 func (gh *GroupsHandle) GroupServeHTTP(w http.ResponseWriter, r *http.Request) {
-	logger.Infow(ctx, "Received-northbound-request", log.Fields{"Method": r.Method, "URL": r.URL})
 	vars := mux.Vars(r)
 	groupID := vars["id"]
+	logger.Infow(ctx, "Received-northbound-request", log.Fields{"Method": r.Method, "groupId": groupID, "URL": r.URL})
 
 	switch r.Method {
 	case cGet:
@@ -60,17 +60,17 @@
 func (gh *GroupsHandle) GetGroupInfo(cntx context.Context, groupID string, w http.ResponseWriter, r *http.Request) {
 	groupResp := GroupList{}
 	groupResp.Groups = []*GroupsInfo{}
+
 	grpID, err := strconv.ParseUint(groupID, 10, 32)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to parse string to uint32", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to parse received groupID from string to uint32", log.Fields{"groupID": groupID, "Reason": err.Error()})
+		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
 	id := uint32(grpID)
-
-	logger.Infow(ctx, "Inside GetGroupInfo method", log.Fields{"groupId": id})
-
 	Groups, err := app.GetController().GetGroups(ctx, id)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to fetch group info", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to fetch group info from Device through grpID", log.Fields{"groupID": groupID, "Reason": err.Error()})
 		w.WriteHeader(http.StatusNotFound)
 		return
 	}
@@ -80,7 +80,7 @@
 
 	GroupsRespJSON, err := json.Marshal(groupResp)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling group response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling group response specific to received groupID", log.Fields{"groupId": id, "GroupResp": groupResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -88,19 +88,20 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(GroupsRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending group response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending group response specific to received groupID", log.Fields{"groupId": id, "GroupResp": groupResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching GroupInfo specific to received groupID", log.Fields{"groupId": id, "GroupResp": groupResp})
 }
 
 func (gh *GroupsHandle) GetAllGroups(cntx context.Context, w http.ResponseWriter, r *http.Request) {
-	logger.Info(cntx, "Inside GetAllGroups method")
 	groupListResp := GroupList{}
 	groupListResp.Groups = []*GroupsInfo{}
 
 	GroupsInfo, err := app.GetController().GetGroupList()
 	if err != nil {
-		logger.Errorw(ctx, "Failed to fetch group info", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to fetch group info from VoltController Device", log.Fields{"Reason": err.Error()})
 		w.WriteHeader(http.StatusNotFound)
 		return
 	}
@@ -112,7 +113,7 @@
 
 	GroupRespJSON, err := json.Marshal(groupListResp)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling meter response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling group List response", log.Fields{"groupListResp": groupListResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -120,7 +121,9 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(GroupRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending meter response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending group List response", log.Fields{"groupListResp": groupListResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching All GroupInfo", log.Fields{"groupListResp": groupListResp})
 }
diff --git a/voltha-go-controller/onos_nbi/maclearning_info.go b/voltha-go-controller/onos_nbi/maclearning_info.go
index cde6b0b..d944d89 100644
--- a/voltha-go-controller/onos_nbi/maclearning_info.go
+++ b/voltha-go-controller/onos_nbi/maclearning_info.go
@@ -40,11 +40,12 @@
 
 // ServeHTTP to serve http request
 func (mlh *MacLearnerHandle) ServeHTTP(w http.ResponseWriter, r *http.Request) {
-	logger.Infow(ctx, "Received-northbound-request", log.Fields{"Method": r.Method, "URL": r.URL})
 	vars := mux.Vars(r)
 	deviceID := vars["deviceId"]
 	portNum := vars["portNumber"]
 	vlanID := vars["vlanId"]
+	logger.Infow(ctx, "Received-northbound-request ", log.Fields{"Method": r.Method, "URL": r.URL, "deviceID": deviceID, "portNum": portNum, "vlanID": vlanID})
+
 	switch r.Method {
 	case cGet:
 		if deviceID == "" && portNum == "" && vlanID == "" {
@@ -60,7 +61,6 @@
 }
 
 func (mlh *MacLearnerHandle) GetAllMacLearnerInfo(cntx context.Context, w http.ResponseWriter, r *http.Request) {
-	logger.Info(cntx, "Inside GetAllMacLearnerInfo method")
 	MacLearnerInfo, err := app.GetApplication().GetAllMacLearnerInfo()
 	if err != nil {
 		logger.Errorw(ctx, "Failed to get mac learning info", log.Fields{"Reason": err.Error()})
@@ -70,7 +70,7 @@
 
 	MliRespJSON, err := json.Marshal(MacLearnerInfo)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling mac learner response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling mac learner response", log.Fields{"MacLearnerInfo": MacLearnerInfo, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -78,13 +78,14 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(MliRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending mac learner response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending mac learner response", log.Fields{"MacLearnerInfo": MacLearnerInfo, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Getting All MacLearnerInfo from DHCP Networks", log.Fields{"MacLearnerInfo": MacLearnerInfo})
 }
 
 func (mlh *MacLearnerHandle) GetMacLearnerInfo(cntx context.Context, deviceID, portNum, vlanID string, w http.ResponseWriter, r *http.Request) {
-	logger.Infow(cntx, "Inside GetMacLearnerInfo method", log.Fields{"deviceID": deviceID, "portNum": portNum, "vlanId": vlanID})
 	MacLearnerInfo, err := app.GetApplication().GetMacLearnerInfo(cntx, deviceID, portNum, vlanID)
 	if err != nil {
 		logger.Errorw(ctx, "Failed to get mac learning info", log.Fields{"Reason": err.Error()})
@@ -94,7 +95,7 @@
 
 	MliRespJSON, err := json.Marshal(MacLearnerInfo)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling mac learner response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling mac learner response", log.Fields{"MacLearnerInfo": MacLearnerInfo, "deviceID": deviceID, "portNum": portNum, "vlanId": vlanID, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -102,7 +103,9 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(MliRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending mac learner response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending mac learner response", log.Fields{"MacLearnerInfo": MacLearnerInfo, "deviceID": deviceID, "portNum": portNum, "vlanId": vlanID, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(cntx, "Get MacLearnerInfo from DHCP Networks specific to deviceID, portNum and vlanID", log.Fields{"MacLearnerInfo": MacLearnerInfo, "deviceID": deviceID, "portNum": portNum, "vlanId": vlanID})
 }
diff --git a/voltha-go-controller/onos_nbi/meters.go b/voltha-go-controller/onos_nbi/meters.go
index 78d715c..5334e7b 100644
--- a/voltha-go-controller/onos_nbi/meters.go
+++ b/voltha-go-controller/onos_nbi/meters.go
@@ -41,14 +41,13 @@
 
 // ServeHTTP to serve http request
 func (mh *MetersHandle) MeterServeHTTP(w http.ResponseWriter, r *http.Request) {
-	logger.Infow(ctx, "Received-northbound-request", log.Fields{"Method": r.Method, "URL": r.URL})
 	vars := mux.Vars(r)
 	meterID := vars["id"]
 
+	logger.Infow(ctx, "Received-northbound-request ", log.Fields{"Method": r.Method, "URL": r.URL, "meterID": meterID})
 	switch r.Method {
 	case cGet:
 		if meterID != "" {
-			logger.Warnw(ctx, "Calling GetMeter method", log.Fields{"MeterId": meterID})
 			mh.GetMeter(context.Background(), meterID, w, r)
 		} else {
 			mh.GetAllMeters(context.Background(), w, r)
@@ -62,12 +61,11 @@
 }
 
 func (mh *MetersHandle) GetMeter(cntx context.Context, meterID string, w http.ResponseWriter, r *http.Request) {
-	logger.Info(cntx, "Inside GetMeter method")
 	meterListResp := MeterList{}
 	meterListResp.Meters = []Meters{}
 	mID, err := strconv.ParseUint(meterID, 10, 32)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to parse string to uint32", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to parse meterID from string to uint32", log.Fields{"Meter ID": mID, "Reason": err.Error()})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -75,7 +73,7 @@
 	logger.Infow(ctx, "Meter Id", log.Fields{"metreId": id})
 	meterInfo, err := app.GetController().GetMeterInfo(cntx, id)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to get meter info", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to get meter info from device with Meter Id", log.Fields{"Meter ID": mID, "Reason": err.Error()})
 		w.WriteHeader(http.StatusNotFound)
 		return
 	}
@@ -86,26 +84,28 @@
 	}
 	MeterRespJSON, err := json.Marshal(meterListResp)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling meter response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling meter response", log.Fields{"Meter ID": mID, "MeterListResp": meterListResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(MeterRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending meter response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending meter response", log.Fields{"Meter ID": mID, "MeterListResp": meterListResp, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetch Meter Info specific to received Meter Id", log.Fields{"metreId": id, "MeterListResp": meterListResp})
 }
 
 func (mh *MetersHandle) GetAllMeters(cntx context.Context, w http.ResponseWriter, r *http.Request) {
-	logger.Info(cntx, "Inside GetAllMeters method")
 	metersList := MeterList{}
 	metersList.Meters = []Meters{}
 	meterInfo, err := app.GetController().GetAllMeterInfo()
 	if err != nil {
 		logger.Errorw(ctx, "Failed to get meter info", log.Fields{"Reason": err.Error()})
 		w.WriteHeader(http.StatusNotFound)
+		return
 	}
 	for deviceID, meters := range meterInfo {
 		for _, meter := range meters {
@@ -115,14 +115,16 @@
 	}
 	MeterRespJSON, err := json.Marshal(metersList)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling meter response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling meter response", log.Fields{"MetersList": metersList, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(MeterRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending meter response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending meter response", log.Fields{"MetersList": metersList, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Fetching all Meter Info from device", log.Fields{"MetersList": metersList})
 }
diff --git a/voltha-go-controller/onos_nbi/models.go b/voltha-go-controller/onos_nbi/models.go
index cc4bed0..0b7ebff 100644
--- a/voltha-go-controller/onos_nbi/models.go
+++ b/voltha-go-controller/onos_nbi/models.go
@@ -792,7 +792,7 @@
 	return port
 }
 func (gh *GroupsHandle) convertGroupsToOnosGroup(groupsInfo *of.Group) *GroupsInfo {
-	logger.Info(ctx, "Entering into convertGroupsToOnosGroup")
+	logger.Debug(ctx, "Entering into convertGroupsToOnosGroup")
 	var groups *GroupsInfo
 	var bucket []Bucket
 	Instruction := []Instructions{}
diff --git a/voltha-go-controller/onos_nbi/oltapprestadapter.go b/voltha-go-controller/onos_nbi/oltapprestadapter.go
index cb926e1..4e31a63 100644
--- a/voltha-go-controller/onos_nbi/oltapprestadapter.go
+++ b/voltha-go-controller/onos_nbi/oltapprestadapter.go
@@ -102,10 +102,12 @@
 	deviceID := vars[DEVICE]
 	portNo := vars["port"]
 
+	logger.Infow(ctx, "Received ActivateService request specific for portNo and deviceID", log.Fields{"portNo": portNo, "deviceID": deviceID})
+
 	// Get the payload to process the request
 	d := new(bytes.Buffer)
 	if _, err := d.ReadFrom(r.Body); err != nil {
-		logger.Warnw(ctx, "Error reading buffer", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Error reading buffer", log.Fields{"portNo": portNo, "deviceID": deviceID, "Reason": err.Error()})
 		http.Error(w, err.Error(), http.StatusConflict)
 		return
 	}
@@ -114,25 +116,25 @@
 		va := app.GetApplication()
 		port, err := strconv.Atoi(portNo)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong port number value", log.Fields{"portNo": portNo})
+			logger.Errorw(ctx, "Wrong port number value", log.Fields{"portNo": portNo, "Error": err})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
 		device := va.GetDevice(deviceID)
 		if device == nil {
-			logger.Warnw(ctx, "Device does not exists", log.Fields{"deviceID": deviceID})
+			logger.Errorw(ctx, "Device does not exists", log.Fields{"deviceID": deviceID})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
 		portName := device.GetPortNameFromPortID(uint32(port))
 		if len(portName) == 0 {
-			logger.Warnw(ctx, "Port does not exists", log.Fields{"deviceID": deviceID})
+			logger.Errorw(ctx, "Port does not exists", log.Fields{"portNo": portNo})
 			err := errorCodes.ErrPortNotFound
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
 		if err := va.ActivateService(cntx, deviceID, portName, of.VlanNone, of.VlanNone, 0); err != nil {
-			logger.Warnw(ctx, "ActivateService Failed", log.Fields{"deviceID": deviceID, "Port": portNo})
+			logger.Errorw(ctx, "ActivateService Failed", log.Fields{"deviceID": deviceID, "Port": portNo, "Error": err})
 			http.Error(w, err.Error(), http.StatusBadRequest)
 		}
 	}
@@ -142,11 +144,12 @@
 	vars := mux.Vars(r)
 	deviceID := vars[DEVICE]
 	portNo := vars["port"]
+	logger.Infow(ctx, "Received DeactivateService request specific for portNo and deviceID", log.Fields{"portNo": portNo, "deviceID": deviceID})
 
 	// Get the payload to process the request
 	d := new(bytes.Buffer)
 	if _, err := d.ReadFrom(r.Body); err != nil {
-		logger.Warnw(ctx, "Error reading buffer", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Error reading buffer", log.Fields{"portNo": portNo, "deviceID": deviceID, "Reason": err.Error()})
 		http.Error(w, err.Error(), http.StatusConflict)
 		return
 	}
@@ -155,25 +158,25 @@
 		va := app.GetApplication()
 		port, err := strconv.Atoi(portNo)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong port number value", log.Fields{"portNo": portNo})
+			logger.Errorw(ctx, "Wrong port number value", log.Fields{"portNo": portNo, "Error": err})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
 		device := va.GetDevice(deviceID)
 		if device == nil {
-			logger.Warnw(ctx, "Device does not exists", log.Fields{"deviceID": deviceID})
+			logger.Errorw(ctx, "Device does not exists", log.Fields{"deviceID": deviceID})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
 		portName := device.GetPortNameFromPortID(uint32(port))
 		if len(portName) == 0 {
-			logger.Warnw(ctx, "Port does not exists", log.Fields{"deviceID": deviceID})
+			logger.Errorw(ctx, "Port does not exists", log.Fields{"portNo": portNo})
 			err := errorCodes.ErrPortNotFound
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
 		if err := va.DeactivateService(cntx, deviceID, portName, of.VlanNone, of.VlanNone, 0); err != nil {
-			logger.Warnw(ctx, "DeactivateService Failed", log.Fields{"deviceID": deviceID, "Port": portNo})
+			logger.Errorw(ctx, "DeactivateService Failed", log.Fields{"deviceID": deviceID, "Port": portNo, "Error": err})
 			http.Error(w, err.Error(), http.StatusBadRequest)
 		}
 	}
@@ -188,11 +191,12 @@
 	sVlan := of.VlanNone
 	cVlan := of.VlanNone
 	techProfile := uint16(0)
+	logger.Infow(ctx, "Received ActivateService request specific for portNo, sVlan, cVlan and techProfile", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile})
 
 	if len(sTag) > 0 {
 		sv, err := strconv.Atoi(sTag)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong vlan value", log.Fields{"sTag": sTag})
+			logger.Errorw(ctx, "Wrong vlan value", log.Fields{"sTag": sTag, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
@@ -201,7 +205,7 @@
 	if len(cTag) > 0 {
 		cv, err := strconv.Atoi(cTag)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong vlan value", log.Fields{"cTag": cTag})
+			logger.Errorw(ctx, "Wrong vlan value", log.Fields{"cTag": cTag, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
@@ -210,7 +214,7 @@
 	if len(tpID) > 0 {
 		tp, err := strconv.Atoi(tpID)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong tech profile value", log.Fields{"tpID": tpID})
+			logger.Errorw(ctx, "Wrong tech profile value", log.Fields{"tpID": tpID, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
@@ -219,10 +223,12 @@
 
 	if len(portNo) > 0 {
 		if err := app.GetApplication().ActivateService(cntx, app.DeviceAny, portNo, sVlan, cVlan, techProfile); err != nil {
-			logger.Warnw(ctx, "ActivateService Failed", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile})
+			logger.Errorw(ctx, "ActivateService Failed", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusBadRequest)
+			return
 		}
 	}
+	logger.Debugw(ctx, "ActivateService request specific for portNo, sVlan, cVlan and techProfile", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile})
 }
 
 func (sa *ServiceAdapter) DeactivateServiceWithPortName(cntx context.Context, w http.ResponseWriter, r *http.Request) {
@@ -234,11 +240,12 @@
 	sVlan := of.VlanNone
 	cVlan := of.VlanNone
 	techProfile := uint16(0)
+	logger.Infow(ctx, "Received DeactivateService request specific for portNo, sVlan, cVlan and techProfile", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile})
 
 	if len(sTag) > 0 {
 		sv, err := strconv.Atoi(sTag)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong vlan value", log.Fields{"sTag": sTag})
+			logger.Errorw(ctx, "Wrong vlan value", log.Fields{"sTag": sTag, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
@@ -247,7 +254,7 @@
 	if len(cTag) > 0 {
 		cv, err := strconv.Atoi(cTag)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong vlan value", log.Fields{"cTag": cTag})
+			logger.Errorw(ctx, "Wrong vlan value", log.Fields{"cTag": cTag, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
@@ -256,7 +263,7 @@
 	if len(tpID) > 0 {
 		tp, err := strconv.Atoi(tpID)
 		if err != nil {
-			logger.Warnw(ctx, "Wrong tech profile value", log.Fields{"tpID": tpID})
+			logger.Errorw(ctx, "Wrong tech profile value", log.Fields{"tpID": tpID, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusConflict)
 			return
 		}
@@ -265,27 +272,33 @@
 
 	if len(portNo) > 0 {
 		if err := app.GetApplication().DeactivateService(cntx, app.DeviceAny, portNo, sVlan, cVlan, techProfile); err != nil {
-			logger.Warnw(ctx, "DeactivateService Failed", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile})
+			logger.Errorw(ctx, "DeactivateService Failed", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile, "Reason": err.Error()})
 			http.Error(w, err.Error(), http.StatusBadRequest)
+			return
 		}
 	}
+	logger.Debugw(ctx, "DeactivateService request specific for portNo, sVlan, cVlan and techProfile", log.Fields{"Port": portNo, "SVlan": sVlan, "CVlan": cVlan, "techProfile": techProfile})
 }
 
 func (sa *ServiceAdapter) GetProgrammedSubscribers(cntx context.Context, w http.ResponseWriter, r *http.Request) {
 	vars := mux.Vars(r)
 	deviceID := vars[DEVICE]
 	portNo := vars["port"]
+	logger.Infow(ctx, "Received Programmed Subscribers request specific for portNo and deviceID", log.Fields{"portNo": portNo, "deviceID": deviceID})
+
 	subsbr := SubscribersList{}
 	subsbr.Subscribers = []SubscriberInfo{}
 	svcs, err := app.GetApplication().GetProgrammedSubscribers(cntx, deviceID, portNo)
 	if err != nil {
-		logger.Errorw(ctx, "Failed to get subscribers", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Failed to get subscribers", log.Fields{"portNo": portNo, "deviceID": deviceID, "Reason": err.Error()})
+		w.WriteHeader(http.StatusNotFound)
+		return
 	}
 	subs := convertServiceToSubscriberInfo(svcs)
 	subsbr.Subscribers = subs
 	subsJSON, err := json.Marshal(subsbr)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling subscriber response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling subscriber response", log.Fields{"Subsbr": subsbr, "portNo": portNo, "deviceID": deviceID, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -293,7 +306,9 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(subsJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending subscriber response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending subscriber response", log.Fields{"Subsbr": subsbr, "portNo": portNo, "deviceID": deviceID, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Programmed Subscribers request specific for portNo and deviceID", log.Fields{"Subsbr": subsbr, "portNo": portNo, "deviceID": deviceID})
 }
diff --git a/voltha-go-controller/onos_nbi/oltflowservice.go b/voltha-go-controller/onos_nbi/oltflowservice.go
index 2da53d3..28d5883 100644
--- a/voltha-go-controller/onos_nbi/oltflowservice.go
+++ b/voltha-go-controller/onos_nbi/oltflowservice.go
@@ -49,14 +49,15 @@
 	// Get the payload to process the request
 	d := new(bytes.Buffer)
 	if _, err := d.ReadFrom(r.Body); err != nil {
-		logger.Warnw(ctx, "Error reading buffer", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Error reading buffer", log.Fields{"Reason": err.Error()})
+		http.Error(w, err.Error(), http.StatusConflict)
 		return
 	}
 
 	// Unmarshal the request into service configuration structure
 	req := &app.OltFlowService{}
 	if err := json.Unmarshal(d.Bytes(), req); err != nil {
-		logger.Warnw(ctx, "Unmarshal Failed", log.Fields{"Reason": err.Error()})
+		logger.Errorw(ctx, "Unmarshal Failed", log.Fields{"req": req, "Reason": err.Error()})
 		http.Error(w, err.Error(), http.StatusConflict)
 		return
 	}
@@ -64,21 +65,22 @@
 }
 
 func (oh *OltFlowServiceHandle) fetchOltFlowService(cntx context.Context, w http.ResponseWriter, r *http.Request) {
-	logger.Info(cntx, "Inside fetchOltFlowService method")
 	oltFlowSer := OltFlowServiceConfig{}
 	va := app.GetApplication()
 
 	oltFlowSer.OltFlowService = va.OltFlowServiceConfig
 	OltFlowRespJSON, err := json.Marshal(oltFlowSer)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling oltFlowService response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling oltFlowService response", log.Fields{"OltFlowService": oltFlowSer.OltFlowService, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(OltFlowRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending olt flow service response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending olt flow service response", log.Fields{"OltFlowService": oltFlowSer.OltFlowService, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(cntx, "Request for Fetching Olt Flow Service", log.Fields{"OltFlowService": oltFlowSer.OltFlowService})
 }
diff --git a/voltha-go-controller/onos_nbi/portIgnored.go b/voltha-go-controller/onos_nbi/portIgnored.go
index 513bb3b..53fe086 100644
--- a/voltha-go-controller/onos_nbi/portIgnored.go
+++ b/voltha-go-controller/onos_nbi/portIgnored.go
@@ -40,7 +40,6 @@
 	logger.Infow(ctx, "Received-northbound-request", log.Fields{"Method": r.Method, "URL": r.URL})
 	switch r.Method {
 	case cGet:
-		logger.Info(ctx, "calling GetIgnoredPortsInfo handler")
 		pih.GetIgnoredPortsInfo(context.Background(), w, r)
 
 	default:
@@ -60,7 +59,7 @@
 
 	PortIgnoredRespJSON, err := json.Marshal(PortIgnoredInfo)
 	if err != nil {
-		logger.Errorw(ctx, "Error occurred while marshaling ignored port response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "Error occurred while marshaling ignored port response", log.Fields{"PortIgnoredInfo": PortIgnoredInfo, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
 		return
 	}
@@ -68,7 +67,9 @@
 	w.Header().Add("Content-Type", "application/json")
 	_, err = w.Write(PortIgnoredRespJSON)
 	if err != nil {
-		logger.Errorw(ctx, "error in sending ignored port response", log.Fields{"Error": err})
+		logger.Errorw(ctx, "error in sending ignored port response", log.Fields{"PortIgnoredInfo": PortIgnoredInfo, "Error": err})
 		w.WriteHeader(http.StatusInternalServerError)
+		return
 	}
+	logger.Debugw(ctx, "Request for get Ignored Ports Info", log.Fields{"PortIgnoredInfo": PortIgnoredInfo})
 }
