diff --git a/common/logger/logger.go b/common/logger/logger.go
index f0bf4aa..b53e86d 100644
--- a/common/logger/logger.go
+++ b/common/logger/logger.go
@@ -30,6 +30,7 @@
 func Setup(kafkaBroker string, level string) {
 
 	logger := log.New()
+	logger.SetReportCaller(true)
 	myLogger = logger.WithField("topics", []string{"bbsim.log"})
 
 	// TODO make this configurable via cli arg
@@ -63,6 +64,10 @@
 	myLogger.WithField("kafkaBroker", kafkaBroker).Debug("Logger setup done")
 }
 
+func GetLogger() *log.Entry {
+	return myLogger
+}
+
 func WithField(key string, value interface{}) *log.Entry {
 	return myLogger.WithField(key, value)
 }
@@ -71,26 +76,26 @@
 	return myLogger.WithFields(fields)
 }
 
-func Panic(args ...interface{}) {
-	myLogger.Panic(fmt.Sprint(args...))
+func Panic(msg string, args ...interface{}) {
+	myLogger.Panic(fmt.Sprintf(msg, args...))
 }
 
-func Fatal(args ...interface{}) {
-	myLogger.Fatal(fmt.Sprint(args...))
+func Fatal(msg string, args ...interface{}) {
+	myLogger.Fatal(fmt.Sprintf(msg, args...))
 }
 
-func Error(args ...interface{}) {
-	myLogger.Error(fmt.Sprint(args...))
+func Error(msg string, args ...interface{}) {
+	myLogger.Error(fmt.Sprintf(msg, args...))
 }
 
-func Warn(args ...interface{}) {
-	myLogger.Warn(fmt.Sprint(args...))
+func Warn(msg string, args ...interface{}) {
+	myLogger.Warn(fmt.Sprintf(msg, args...))
 }
 
-func Info(args ...interface{}) {
-	myLogger.Info(fmt.Sprint(args...))
+func Info(msg string, args ...interface{}) {
+	myLogger.Info(fmt.Sprintf(msg, args...))
 }
 
-func Debug(args ...interface{}) {
-	myLogger.Debug(fmt.Sprint(args...))
+func Debug(msg string, args ...interface{}) {
+	myLogger.Debug(fmt.Sprintf(msg, args...))
 }
diff --git a/common/utils/utils.go b/common/utils/utils.go
index a8fc3ba..f532d51 100644
--- a/common/utils/utils.go
+++ b/common/utils/utils.go
@@ -19,11 +19,29 @@
 import (
 	"fmt"
 
+	"gerrit.opencord.org/voltha-bbsim/common/logger"
+
 	"gerrit.opencord.org/voltha-bbsim/device"
+	log "github.com/sirupsen/logrus"
 )
 
 func OnuToSn(onu *device.Onu) string {
-	// TODO this can be more elegant,
+	// FIXME
 	// see https://github.com/opencord/voltha/blob/master/voltha/adapters/openolt/openolt_device.py#L929-L943
-	return string(onu.SerialNumber.VendorId) + "00000" + fmt.Sprint(onu.IntfID) + "0" + fmt.Sprintf("%x", onu.OnuID)
+	return string(onu.SerialNumber.VendorId) + "00000" + fmt.Sprint(onu.IntfID) + "0" + fmt.Sprintf("%x", onu.OnuID-1)
+}
+
+func LoggerWithOnu(onu *device.Onu) *log.Entry {
+
+	if onu == nil {
+		logger.Warn("utils.LoggerWithOnu has been called without Onu")
+		return logger.GetLogger()
+	}
+
+	return logger.WithFields(log.Fields{
+		"serial_number": OnuToSn(onu),
+		"interfaceId":   onu.IntfID,
+		"onuId":         onu.OnuID,
+		"oltId":         onu.OltID,
+	})
 }
diff --git a/core/core_server.go b/core/core_server.go
index 55166dc..48f0ed8 100644
--- a/core/core_server.go
+++ b/core/core_server.go
@@ -98,7 +98,7 @@
 	}
 
 	nnni := s.Olt.NumNniIntf
-	logger.Info("OLT ID: %d was retrieved.\n", s.Olt.ID)
+	logger.Info("OLT ID: %d was retrieved.", s.Olt.ID)
 	for intfid := nnni; intfid < npon+nnni; intfid++ {
 		s.Onumap[intfid] = device.NewOnus(oltid, intfid, nonus, nnni)
 	}
@@ -204,23 +204,23 @@
 	}
 	olt.OperState = "up"
 	*olt.InternalState = device.OLT_UP
-	logger.Info("OLT %s sent OltInd.\n", olt.Name)
+	logger.Info("OLT %s sent OltInd.", olt.Name)
 
 	// OLT sends Interface Indication to Adapter
 	if err := sendIntfInd(stream, olt); err != nil {
-		logger.Error("Fail to sendIntfInd: %v\n", err)
+		logger.Error("Fail to sendIntfInd: %v", err)
 		return err
 	}
-	logger.Info("OLT %s sent IntfInd.\n", olt.Name)
+	logger.Info("OLT %s sent IntfInd.", olt.Name)
 
 	// OLT sends Operation Indication to Adapter after activating each interface
 	//time.Sleep(IF_UP_TIME * time.Second)
 	*olt.InternalState = device.PONIF_UP
 	if err := sendOperInd(stream, olt); err != nil {
-		logger.Error("Fail to sendOperInd: %v\n", err)
+		logger.Error("Fail to sendOperInd: %v", err)
 		return err
 	}
-	logger.Info("OLT %s sent OperInd.\n", olt.Name)
+	logger.Info("OLT %s sent OperInd.", olt.Name)
 
 	// OLT sends ONU Discover Indication to Adapter after ONU discovery
 	for intfid, _ := range s.Onumap {
@@ -229,7 +229,7 @@
 
 	for intfid, _ := range s.Onumap {
 		sendOnuDiscInd(stream, s.Onumap[intfid])
-		logger.Info("OLT id:%d sent ONUDiscInd.\n", olt.ID)
+		logger.Info("OLT id:%d sent ONUDiscInd.", olt.ID)
 	}
 
 	// OLT Sends OnuInd after waiting all of those ONUs up
@@ -242,7 +242,7 @@
 
 	for intfid, _ := range s.Onumap {
 		sendOnuInd(stream, s.Onumap[intfid], s.IndInterval)
-		logger.Info("OLT id:%d sent ONUInd.\n", olt.ID)
+		logger.Info("OLT id:%d sent ONUInd.", olt.ID)
 	}
 	return nil
 }
@@ -327,7 +327,7 @@
 			onuid := onu.OnuID
 			ioinfo, err := s.identifyUniIoinfo("inside", intfid, onuid)
 			if err != nil {
-				logger.Error("Fail to identifyUniIoinfo (onuid: %d): %v\n", onuid, err)
+				utils.LoggerWithOnu(onu).Error("Fail to identifyUniIoinfo (onuid: %d): %v", onuid, err)
 				return err
 			}
 			uhandler := ioinfo.handler
@@ -350,7 +350,7 @@
 		case unipkt := <-unichannel:
 			logger.Debug("Received packet in grpc Server from UNI.")
 			if unipkt.Info == nil || unipkt.Info.iotype != "uni" {
-				logger.Info("WARNING: This packet does not come from UNI ")
+				logger.Debug("WARNING: This packet does not come from UNI ")
 				continue
 			}
 
@@ -361,57 +361,39 @@
 			layerEth := pkt.Layer(layers.LayerTypeEthernet)
 			le, _ := layerEth.(*layers.Ethernet)
 			ethtype := le.EthernetType
-			onu, _ := getOnuByID(s.Onumap, onuid)
+			onu, _ := s.GetOnuByID(onuid)
 
 			if ethtype == 0x888e {
-				logger.WithFields(log.Fields{
-					"serial_number": utils.OnuToSn(onu),
-					"gemId":         gemid,
-					"interfaceId":   intfid,
-					"onuId":         onuid,
-				}).Debug("Received upstream packet is EAPOL.")
+				utils.LoggerWithOnu(onu).WithFields(log.Fields{
+					"gemId": gemid,
+				}).Info("Received upstream packet is EAPOL.")
 			} else if layerDHCP := pkt.Layer(layers.LayerTypeDHCPv4); layerDHCP != nil {
-				logger.WithFields(log.Fields{
-					"serial_number": utils.OnuToSn(onu),
-					"gemId":         gemid,
-					"interfaceId":   intfid,
-					"onuId":         onuid,
-				}).Debug("Received upstream packet is DHCP.")
+				utils.LoggerWithOnu(onu).WithFields(log.Fields{
+					"gemId": gemid,
+				}).Info("Received upstream packet is DHCP.")
 
 				//C-TAG
 				sn := convB2S(onu.SerialNumber.VendorSpecific)
 				if ctag, ok := s.CtagMap[sn]; ok == true {
 					tagpkt, err := PushVLAN(pkt, uint16(ctag))
 					if err != nil {
-						logger.WithFields(log.Fields{
-							"serial_number": utils.OnuToSn(onu),
-							"gemId":         gemid,
-							"interfaceId":   intfid,
-							"onuId":         onuid,
+						utils.LoggerWithOnu(onu).WithFields(log.Fields{
+							"gemId": gemid,
 						}).Error("Fail to tag C-tag")
 					} else {
 						pkt = tagpkt
 					}
 				} else {
-					logger.WithFields(log.Fields{
-						"serial_number": utils.OnuToSn(onu),
-						"gemId":         gemid,
-						"interfaceId":   intfid,
-						"onuId":         onuid,
-						"sn":            sn,
-						"cTagMap":       s.CtagMap,
+					utils.LoggerWithOnu(onu).WithFields(log.Fields{
+						"gemId":   gemid,
+						"cTagMap": s.CtagMap,
 					}).Error("Could not find onuid in CtagMap", onuid, sn, s.CtagMap)
 				}
 			} else {
 				continue
 			}
 
-			logger.WithFields(log.Fields{
-				"serial_number": utils.OnuToSn(onu),
-				"gemId":         gemid,
-				"interfaceId":   intfid,
-				"onuId":         onuid,
-			}).Debug("sendPktInd")
+			utils.LoggerWithOnu(onu).Info("sendPktInd - UNI Packet")
 			data = &openolt.Indication_PktInd{PktInd: &openolt.PacketIndication{IntfType: "pon", IntfId: intfid, GemportId: gemid, Pkt: pkt.Data()}}
 			if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
 				logger.Error("Fail to send PktInd indication.", err)
@@ -420,19 +402,16 @@
 
 		case nnipkt := <-nnichannel:
 			if nnipkt.Info == nil || nnipkt.Info.iotype != "nni" {
-				logger.Info("WARNING: This packet does not come from NNI ")
+				logger.Debug("WARNING: This packet does not come from NNI ")
 				continue
 			}
 			onuid := nnipkt.Info.onuid
 			onu, _ := getOnuByID(s.Onumap, onuid)
 
-			logger.Debug("Received packet in grpc Server from NNI.")
+			utils.LoggerWithOnu(onu).Info("Received packet in grpc Server from NNI.")
 			intfid := nnipkt.Info.intfid
 			pkt := nnipkt.Pkt
-			logger.WithFields(log.Fields{
-				"interfaceId":   intfid,
-				"serial_number": utils.OnuToSn(onu),
-			}).Info("sendPktInd")
+			utils.LoggerWithOnu(onu).Info("sendPktInd - NNI Packet")
 			data = &openolt.Indication_PktInd{PktInd: &openolt.PacketIndication{IntfType: "nni", IntfId: intfid, Pkt: pkt.Data()}}
 			if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
 				logger.Error("Fail to send PktInd indication.", err)
@@ -453,15 +432,15 @@
 
 func (s *Server) onuPacketOut(intfid uint32, onuid uint32, rawpkt gopacket.Packet) error {
 	layerEth := rawpkt.Layer(layers.LayerTypeEthernet)
+	onu, _ := s.GetOnuByID(onuid)
+
 	if layerEth != nil {
 		pkt, _ := layerEth.(*layers.Ethernet)
 		ethtype := pkt.EthernetType
 		if ethtype == 0x888e {
-			logger.Debug("Received downstream packet is EAPOL.")
-			//logger.Println(rawpkt.Dump())
+			utils.LoggerWithOnu(onu).Info("Received downstream packet is EAPOL.")
 		} else if layerDHCP := rawpkt.Layer(layers.LayerTypeDHCPv4); layerDHCP != nil {
-			logger.Debug("Received downstream packet is DHCP.")
-			//logger.Println(rawpkt.Dump())
+			utils.LoggerWithOnu(onu).Info("Received downstream packet is DHCP.")
 			rawpkt, _, _ = PopVLAN(rawpkt)
 			rawpkt, _, _ = PopVLAN(rawpkt)
 		} else {
@@ -525,6 +504,10 @@
 	return nil, err
 }
 
+func (s *Server) GetOnuByID(onuid uint32) (*device.Onu, error) {
+	return getOnuByID(s.Onumap, onuid)
+}
+
 func getOnuByID(onumap map[uint32][]*device.Onu, onuid uint32) (*device.Onu, error) {
 	for _, onus := range onumap {
 		for _, onu := range onus {
@@ -534,7 +517,10 @@
 		}
 	}
 	err := errors.New("No matched OnuID is found ")
-	logger.Error("%s", err)
+	logger.WithFields(log.Fields{
+		"onumap": onumap,
+		"onuid":  onuid,
+	}).Error(err)
 	return nil, err
 }
 
diff --git a/core/grpc_service.go b/core/grpc_service.go
index 75d8845..61096f4 100644
--- a/core/grpc_service.go
+++ b/core/grpc_service.go
@@ -20,131 +20,134 @@
 	"net"
 
 	"gerrit.opencord.org/voltha-bbsim/common/logger"
+	"gerrit.opencord.org/voltha-bbsim/common/utils"
 	"gerrit.opencord.org/voltha-bbsim/device"
 	"gerrit.opencord.org/voltha-bbsim/protos"
 	"github.com/google/gopacket"
 	"github.com/google/gopacket/layers"
+	log "github.com/sirupsen/logrus"
 	"golang.org/x/net/context"
 	"google.golang.org/grpc"
 )
 
 // gRPC Service
 func (s *Server) DisableOlt(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
-	logger.Info("OLT receives DisableOLT()\n")
+	logger.Debug("OLT receives DisableOLT()")
 	if s.EnableServer != nil {
 		if err := sendOltIndDown(*s.EnableServer); err != nil {
 			return new(openolt.Empty), err
 		}
-		logger.Info("Successfuly sent OLT DOWN indication")
+		logger.Debug("Successfuly sent OLT DOWN indication")
 	}
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) ReenableOlt(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
-	logger.Info("OLT receives Reenable()\n")
+	logger.Debug("OLT receives Reenable()")
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) CollectStatistics(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
-	logger.Info("OLT receives CollectStatistics()\n")
+	logger.Debug("OLT receives CollectStatistics()")
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) GetDeviceInfo(c context.Context, empty *openolt.Empty) (*openolt.DeviceInfo, error) {
-    logger.Info("OLT receives GetDeviceInfo()\n")
-    devinfo := new(openolt.DeviceInfo)
-    devinfo.Vendor = "EdgeCore"
-    devinfo.Model = "asfvolt16"
-    devinfo.HardwareVersion = ""
-    devinfo.FirmwareVersion = ""
-    devinfo.Technology = "xgspon"
-    devinfo.PonPorts = 1
-    devinfo.OnuIdStart = 1
-    devinfo.OnuIdEnd = 255
-    devinfo.AllocIdStart = 1024
-    devinfo.AllocIdEnd = 16383
-    devinfo.GemportIdStart = 1024
-    devinfo.GemportIdEnd = 65535
-    devinfo.FlowIdStart = 1
-    devinfo.FlowIdEnd = 16383
+	logger.Debug("OLT receives GetDeviceInfo()")
+	devinfo := new(openolt.DeviceInfo)
+	devinfo.Vendor = "EdgeCore"
+	devinfo.Model = "asfvolt16"
+	devinfo.HardwareVersion = ""
+	devinfo.FirmwareVersion = ""
+	devinfo.Technology = "xgspon"
+	devinfo.PonPorts = 1
+	devinfo.OnuIdStart = 1
+	devinfo.OnuIdEnd = 255
+	devinfo.AllocIdStart = 1024
+	devinfo.AllocIdEnd = 16383
+	devinfo.GemportIdStart = 1024
+	devinfo.GemportIdEnd = 65535
+	devinfo.FlowIdStart = 1
+	devinfo.FlowIdEnd = 16383
 
-     /*
-     for intf_id := 0; intf_id < 16; intf_id++ {
-        r := new(openolt.DeviceInfo_DeviceResourceRanges)
+	/*
+	    for intf_id := 0; intf_id < 16; intf_id++ {
+	       r := new(openolt.DeviceInfo_DeviceResourceRanges)
 
-        r.IntfIds = append(r.IntfIds, uint32(intf_id))
+	       r.IntfIds = append(r.IntfIds, uint32(intf_id))
 
-        r.Technology = "xgspon"
+	       r.Technology = "xgspon"
 
-        p := new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
-        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ONU_ID
-        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_DEDICATED_PER_INTF
-        p.Start = 1
-        p.End = 255
-        r.Pools = append(r.Pools, p)
+	       p := new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+	       p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ONU_ID
+	       p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_DEDICATED_PER_INTF
+	       p.Start = 1
+	       p.End = 255
+	       r.Pools = append(r.Pools, p)
 
-        p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
-        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ALLOC_ID
-        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_SAME_TECH
-        p.Start = 1024
-        p.End = 16383
-        r.Pools = append(r.Pools, p)
+	       p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+	       p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_ALLOC_ID
+	       p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_SAME_TECH
+	       p.Start = 1024
+	       p.End = 16383
+	       r.Pools = append(r.Pools, p)
 
-        p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
-        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_GEMPORT_ID
-        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
-        p.Start = 1024
-        p.End = 65535
-        r.Pools = append(r.Pools, p)
+	       p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+	       p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_GEMPORT_ID
+	       p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
+	       p.Start = 1024
+	       p.End = 65535
+	       r.Pools = append(r.Pools, p)
 
-        p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
-        p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_FLOW_ID
-        p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
-        p.Start = 1
-        p.End = 16383
-        r.Pools = append(r.Pools, p)
+	       p = new(openolt.DeviceInfo_DeviceResourceRanges_Pool)
+	       p.Type = openolt.DeviceInfo_DeviceResourceRanges_Pool_FLOW_ID
+	       p.Sharing = openolt.DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH
+	       p.Start = 1
+	       p.End = 16383
+	       r.Pools = append(r.Pools, p)
 
-        devinfo.Ranges = append(devinfo.Ranges, r)
-    }
-    */
+	       devinfo.Ranges = append(devinfo.Ranges, r)
+	   }
+	*/
 
 	return devinfo, nil
 }
 
 func (s *Server) ActivateOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
-	logger.Info("OLT receives ActivateONU()\n")
+	logger.Debug("OLT receives ActivateONU()")
 	result := device.ValidateONU(*onu, s.Onumap)
 	if result == true {
 		matched, error := getOnuBySN(s.Onumap, onu.SerialNumber)
 		if error != nil {
-			logger.Fatal("%s\n", error)
+			logger.Fatal("%s", error)
 		}
 		onuid := onu.OnuId
 		matched.OnuID = onuid
 		matched.UpdateIntStatus(device.ONU_ACTIVATED)
-		logger.Info("ONU IntfID: %d OnuID: %d activated succesufully.\n", onu.IntfId, onu.OnuId)
+		logger.Debug("ONU IntfID: %d OnuID: %d activated succesufully.", onu.IntfId, onu.OnuId)
 	}
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) DeactivateOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
-	logger.Info("OLT receives DeactivateONU()\n")
+	logger.Debug("OLT receives DeactivateONU()")
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) DeleteOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
-	logger.Info("OLT receives DeleteONU()\n")
+	logger.Debug("OLT receives DeleteONU()")
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) OmciMsgOut(c context.Context, msg *openolt.OmciMsg) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives OmciMsgOut to IF %v (ONU-ID: %v) pkt:%x.\n", s.Olt.ID, msg.IntfId, msg.OnuId, msg.Pkt)
+	logger.Debug("OLT %d receives OmciMsgOut to IF %v (ONU-ID: %v) pkt:%x.", s.Olt.ID, msg.IntfId, msg.OnuId, msg.Pkt)
 	//s.olt.Queue = append(s.olt.Queue, *msg)
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) OnuPacketOut(c context.Context, packet *openolt.OnuPacket) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives OnuPacketOut () to IF-ID:%d ONU-ID %d.\n", s.Olt.ID, packet.IntfId, packet.OnuId)
+	onu, _ := s.GetOnuByID(packet.OnuId)
+	utils.LoggerWithOnu(onu).Debug("OLT %d receives OnuPacketOut () to IF-ID:%d ONU-ID %d.", s.Olt.ID, packet.IntfId, packet.OnuId)
 	onuid := packet.OnuId
 	intfid := packet.IntfId
 	rawpkt := gopacket.NewPacket(packet.Pkt, layers.LayerTypeEthernet, gopacket.Default)
@@ -155,7 +158,7 @@
 }
 
 func (s *Server) UplinkPacketOut(c context.Context, packet *openolt.UplinkPacket) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives UplinkPacketOut().\n", s.Olt.ID)
+	logger.Debug("OLT %d receives UplinkPacketOut().", s.Olt.ID)
 	rawpkt := gopacket.NewPacket(packet.Pkt, layers.LayerTypeEthernet, gopacket.Default)
 	if err := s.uplinkPacketOut(rawpkt); err != nil {
 		return new(openolt.Empty), err
@@ -164,38 +167,47 @@
 }
 
 func (s *Server) FlowAdd(c context.Context, flow *openolt.Flow) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives FlowAdd().\n", s.Olt.ID)
-	logger.Debug("Flow's ONU-ID: %d, CTAG: %d\n", flow.OnuId, flow.Action.IVid)
-	//onuid := uint32(flow.OnuId)
-	//ctag := flow.Action.IVid
-	//s.CtagMap[onuid] = ctag
+
+	onu, _ := s.GetOnuByID(uint32(flow.OnuId))
+
+	utils.LoggerWithOnu(onu).WithFields(log.Fields{
+		"olt":   s.Olt.ID,
+		"c_tag": flow.Action.IVid,
+	}).Debug("OLT receives FlowAdd().")
+
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) FlowRemove(c context.Context, flow *openolt.Flow) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives FlowRemove().\n", s.Olt.ID)
+	onu, _ := s.GetOnuByID(uint32(flow.OnuId))
+
+	utils.LoggerWithOnu(onu).WithFields(log.Fields{
+		"olt":   s.Olt.ID,
+		"c_tag": flow.Action.IVid,
+	}).Debug("OLT receives FlowRemove().")
+
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) HeartbeatCheck(c context.Context, empty *openolt.Empty) (*openolt.Heartbeat, error) {
-	logger.Info("OLT %d receives HeartbeatCheck().\n", s.Olt.ID)
+	logger.Debug("OLT %d receives HeartbeatCheck().", s.Olt.ID)
 	signature := new(openolt.Heartbeat)
 	signature.HeartbeatSignature = s.Olt.HeartbeatSignature
 	return signature, nil
 }
 
 func (s *Server) EnablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives EnablePonIf().\n", s.Olt.ID)
+	logger.Debug("OLT %d receives EnablePonIf().", s.Olt.ID)
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) DisablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives DisablePonIf().\n", s.Olt.ID)
+	logger.Debug("OLT %d receives DisablePonIf().", s.Olt.ID)
 	return new(openolt.Empty), nil
 }
 
 func (s *Server) Reboot(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
-	logger.Info("OLT %d receives Reboot ().\n", s.Olt.ID)
+	logger.Debug("OLT %d receives Reboot ().", s.Olt.ID)
 	// Initialize OLT & Env
 	logger.Debug("Initialized by Reboot")
 	s.Disable()
@@ -203,19 +215,19 @@
 }
 
 func (s *Server) EnableIndication(empty *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error {
-	logger.Info("OLT receives EnableInd.\n")
+	logger.Debug("OLT receives EnableInd.")
 	defer func() {
 		logger.Debug("grpc EnableIndication Done")
 	}()
 	if err := s.Enable(&stream); err != nil {
-		logger.Error("Failed to Enable Core: %v\n", err)
+		logger.Error("Failed to Enable Core: %v", err)
 		return err
 	}
 	return nil
 }
 
 func NewGrpcServer(addrport string) (l net.Listener, g *grpc.Server, e error) {
-	logger.Info("Listening %s ...", addrport)
+	logger.Debug("Listening %s ...", addrport)
 	g = grpc.NewServer()
 	l, e = net.Listen("tcp", addrport)
 	return
diff --git a/core/io_info.go b/core/io_info.go
index 867c88c..d104efc 100644
--- a/core/io_info.go
+++ b/core/io_info.go
@@ -41,7 +41,7 @@
 		}
 	}
 	err := errors.New("No matched Ioinfo is found")
-	logger.Error(err)
+	logger.Error("identifyUniIoinfo %s", err)
 	return nil, err
 }
 
@@ -52,7 +52,7 @@
 		}
 	}
 	err := errors.New("No matched Ioinfo is found")
-	logger.Error(err)
+	logger.Error("IdentifyNniIoinfo %s", err)
 	return nil, err
 }
 
@@ -65,7 +65,7 @@
 	}
 	if len(ioinfos) == 0 {
 		err := errors.New("No matched Ioinfo is found")
-		logger.Error(err)
+		logger.Error("GetUniIoinfos %s", err)
 		return nil, err
 	}
 	return ioinfos, nil
diff --git a/core/io_worker.go b/core/io_worker.go
index 9a6cb6c..2657e4c 100644
--- a/core/io_worker.go
+++ b/core/io_worker.go
@@ -32,7 +32,7 @@
 	logger.Debug("recvWorker runs. handler: %v", *handler)
 	packetSource := gopacket.NewPacketSource(handler, handler.LinkType())
 	for packet := range packetSource.Packets() {
-		logger.Debug("recv packet from IF: %v \n", *handler)
+		logger.Debug("recv packet from IF: %v ", *handler)
 		//logger.Println(packet.Dump())
 		pkt := Packet{}
 		pkt.Info = io
@@ -44,18 +44,18 @@
 func SendUni(handle *pcap.Handle, packet gopacket.Packet) {
 	err := handle.WritePacketData(packet.Data())
 	if err != nil {
-		logger.Error("Error in send packet to UNI-IF: %v e:%s\n", *handle, err)
+		logger.Error("Error in send packet to UNI-IF: %v e:%s", *handle, err)
 	}
-	logger.Debug("Successfully send packet to UNI-IF: %v \n", *handle)
+	logger.Debug("Successfully send packet to UNI-IF: %v ", *handle)
 	//logger.Println(packet.Dump())
 }
 
 func SendNni(handle *pcap.Handle, packet gopacket.Packet) {
 	err := handle.WritePacketData(packet.Data())
 	if err != nil {
-		logger.Error("Error in send packet to NNI e:%s\n", err)
+		logger.Error("Error in send packet to NNI e:%s", err)
 	}
-	logger.Debug("send packet to NNI-IF: %v \n", *handle)
+	logger.Debug("send packet to NNI-IF: %v ", *handle)
 	//logger.Println(packet.Dump())
 }
 
@@ -183,6 +183,6 @@
 	if err != nil {
 		return nil, err
 	}
-	logger.Debug("Server handle is created for %s\n", vethname)
+	logger.Debug("Server handle is created for %s", vethname)
 	return handle, nil
 }
diff --git a/core/mediator.go b/core/mediator.go
index a6d67b0..ee25264 100644
--- a/core/mediator.go
+++ b/core/mediator.go
@@ -129,7 +129,7 @@
 	wg.Add(1)
 	go func() {
 		if err := server.Start(); err != nil { //Blocking
-			logger.Error(err)
+			logger.Error("Start %s", err)
 		}
 		wg.Done()
 		return
diff --git a/core/openolt_service.go b/core/openolt_service.go
index 41e6548..364d0c3 100644
--- a/core/openolt_service.go
+++ b/core/openolt_service.go
@@ -23,13 +23,12 @@
 	"gerrit.opencord.org/voltha-bbsim/common/utils"
 	"gerrit.opencord.org/voltha-bbsim/device"
 	"gerrit.opencord.org/voltha-bbsim/protos"
-	log "github.com/sirupsen/logrus"
 )
 
 func sendOltIndUp(stream openolt.Openolt_EnableIndicationServer, olt *device.Olt) error {
 	data := &openolt.Indication_OltInd{OltInd: &openolt.OltIndication{OperState: "up"}}
 	if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-		logger.Error("Failed to send OLT UP indication: %v\n", err)
+		logger.Error("Failed to send OLT UP indication: %v", err)
 		return err
 	}
 	return nil
@@ -38,7 +37,7 @@
 func sendOltIndDown(stream openolt.Openolt_EnableIndicationServer) error {
 	data := &openolt.Indication_OltInd{OltInd: &openolt.OltIndication{OperState: "down"}}
 	if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-		logger.Error("Failed to send OLT DOWN indication: %v\n", err)
+		logger.Error("Failed to send OLT DOWN indication: %v", err)
 		return err
 	}
 	return nil
@@ -50,10 +49,10 @@
 		if intf.Type == "pon" { // There is no need to send IntfInd for NNI
 			data := &openolt.Indication_IntfInd{&openolt.IntfIndication{IntfId: intf.IntfID, OperState: intf.OperState}}
 			if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-				logger.Error("Failed to send Intf [id: %d] indication : %v\n", i, err)
+				logger.Error("Failed to send Intf [id: %d] indication : %v", i, err)
 				return err
 			}
-			logger.Info("SendIntfInd olt:%d intf:%d (%s)\n", olt.ID, intf.IntfID, intf.Type)
+			logger.Info("SendIntfInd olt:%d intf:%d (%s)", olt.ID, intf.IntfID, intf.Type)
 		}
 	}
 	return nil
@@ -64,10 +63,10 @@
 		intf := olt.Intfs[i]
 		data := &openolt.Indication_IntfOperInd{&openolt.IntfOperIndication{Type: intf.Type, IntfId: intf.IntfID, OperState: intf.OperState}}
 		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			logger.Error("Failed to send IntfOper [id: %d] indication : %v\n", i, err)
+			logger.Error("Failed to send IntfOper [id: %d] indication : %v", i, err)
 			return err
 		}
-		logger.Info("SendOperInd olt:%d intf:%d (%s)\n", olt.ID, intf.IntfID, intf.Type)
+		logger.Info("SendOperInd olt:%d intf:%d (%s)", olt.ID, intf.IntfID, intf.Type)
 	}
 	return nil
 }
@@ -76,15 +75,10 @@
 	for i, onu := range onus {
 		data := &openolt.Indication_OnuDiscInd{&openolt.OnuDiscIndication{IntfId: onu.IntfID, SerialNumber: onu.SerialNumber}}
 		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			logger.Error("Failed to send ONUDiscInd [id: %d]: %v\n", i, err)
+			logger.Error("Failed to send ONUDiscInd [id: %d]: %v", i, err)
 			return err
 		}
-		logger.WithFields(log.Fields{
-			"serial_number": utils.OnuToSn(onu),
-			"interfaceId":   onu.IntfID,
-			"onuId":         onu.OnuID,
-			"oltId":         onu.OltID,
-		}).Info("sendONUDiscInd Onuid")
+		utils.LoggerWithOnu(onu).Info("sendONUDiscInd Onuid")
 	}
 	return nil
 }
@@ -94,15 +88,10 @@
 		time.Sleep(time.Duration(delay) * time.Second)
 		data := &openolt.Indication_OnuInd{&openolt.OnuIndication{IntfId: onu.IntfID, OnuId: onu.OnuID, OperState: "up", AdminState: "up", SerialNumber: onu.SerialNumber}}
 		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			logger.Error("Failed to send ONUInd [id: %d]: %v\n", i, err)
+			logger.Error("Failed to send ONUInd [id: %d]: %v", i, err)
 			return err
 		}
-		logger.WithFields(log.Fields{
-			"serial_number": utils.OnuToSn(onu),
-			"interfaceId":   onu.IntfID,
-			"onuId":         onu.OnuID,
-			"oltId":         onu.OltID,
-		}).Info("sendONUInd Onuid")
+		utils.LoggerWithOnu(onu).Info("sendONUInd Onuid")
 	}
 	return nil
 }
diff --git a/core/tester.go b/core/tester.go
index cd4f96a..e665aa3 100644
--- a/core/tester.go
+++ b/core/tester.go
@@ -23,6 +23,7 @@
 	"time"
 
 	"gerrit.opencord.org/voltha-bbsim/common/logger"
+	"gerrit.opencord.org/voltha-bbsim/common/utils"
 	log "github.com/sirupsen/logrus"
 	"golang.org/x/sync/errgroup"
 )
@@ -116,6 +117,11 @@
 	exec.Command("touch", "/var/run/dhcpd.pid").Run() //This is for DHCP server activation
 }
 
+type UniVeth struct {
+	OnuId uint32
+	Veth  string
+}
+
 func (t *Tester) exeAAATest(ctx context.Context, s *Server, wait int) error {
 	tick := time.NewTicker(time.Second)
 	defer tick.Stop()
@@ -125,9 +131,13 @@
 		return err
 	}
 
-	univeths := []string{}
+	univeths := []UniVeth{}
 	for _, info := range infos {
-		univeths = append(univeths, info.Name)
+		uv := UniVeth{
+			OnuId: info.onuid,
+			Veth:  info.Name,
+		}
+		univeths = append(univeths, uv)
 	}
 
 	for sec := 1; sec <= wait; sec++ {
@@ -136,13 +146,13 @@
 			logger.Debug("exeAAATest thread receives close ")
 			return nil
 		case <-tick.C:
-			logger.WithField("seconds", wait-sec).Info("exeAAATest stands by ...")
+			logger.WithField("seconds", wait-sec).Info("exeAAATest stands by ... ", wait-sec)
 			if sec == wait {
 				wg := sync.WaitGroup{}
 				wg.Add(1)
 				go func() error {
 					defer wg.Done()
-					err = activateWPASups(ctx, univeths, t.Intvl)
+					err = activateWPASups(ctx, univeths, t.Intvl, s)
 					if err != nil {
 						return err
 					}
@@ -179,9 +189,13 @@
 		return err
 	}
 
-	univeths := []string{}
+	univeths := []UniVeth{}
 	for _, info := range infos {
-		univeths = append(univeths, info.Name)
+		uv := UniVeth{
+			OnuId: info.onuid,
+			Veth:  info.Name,
+		}
+		univeths = append(univeths, uv)
 	}
 
 	for sec := 1; sec <= wait; sec++ {
@@ -190,13 +204,13 @@
 			logger.Debug("exeDHCPTest thread receives close ")
 			return nil
 		case <-tick.C:
-			logger.WithField("seconds", wait-sec).Info("exeDHCPTest stands by ...")
+			logger.WithField("seconds", wait-sec).Info("exeDHCPTest stands by ... ", wait-sec)
 			if sec == wait {
 				wg := sync.WaitGroup{}
 				wg.Add(1)
 				go func() error {
 					defer wg.Done()
-					err = activateDHCPClients(ctx, univeths, t.Intvl)
+					err = activateDHCPClients(ctx, univeths, t.Intvl, s)
 					if err != nil {
 						return err
 					}
@@ -221,7 +235,7 @@
 	return nil
 }
 
-func activateWPASups(ctx context.Context, vethnames []string, intvl int) error {
+func activateWPASups(ctx context.Context, vethnames []UniVeth, intvl int, s *Server) error {
 	tick := time.NewTicker(time.Duration(intvl) * time.Second)
 	defer tick.Stop()
 	i := 0
@@ -230,10 +244,9 @@
 		case <-tick.C:
 			if i < len(vethnames) {
 				vethname := vethnames[i]
-				if err := activateWPASupplicant(vethname); err != nil {
+				if err := activateWPASupplicant(vethname, s); err != nil {
 					return err
 				}
-				logger.Debug("activateWPASupplicant for interface %v\n", vethname)
 				i++
 			}
 		case <-ctx.Done():
@@ -244,7 +257,7 @@
 	return nil
 }
 
-func activateDHCPClients(ctx context.Context, vethnames []string, intvl int) error {
+func activateDHCPClients(ctx context.Context, vethnames []UniVeth, intvl int, s *Server) error {
 	tick := time.NewTicker(time.Duration(intvl) * time.Second)
 	defer tick.Stop()
 	i := 0
@@ -253,12 +266,9 @@
 		case <-tick.C:
 			if i < len(vethnames) {
 				vethname := vethnames[i]
-				if err := activateDHCPClient(vethname); err != nil {
+				if err := activateDHCPClient(vethname, s); err != nil {
 					return err
 				}
-				logger.WithFields(log.Fields{
-					"interface": vethname,
-				}).Debug("activateDHCPClient")
 				i++
 			}
 		case <-ctx.Done():
@@ -272,55 +282,61 @@
 func killProcess(name string) error {
 	err := exec.Command("pkill", name).Run()
 	if err != nil {
-		logger.Error("Fail to pkill %s: %v\n", name, err)
+		logger.Error("Fail to pkill %s: %v", name, err)
 		return err
 	}
-	logger.Info("Successfully killed %s\n", name)
+	logger.Info("Successfully killed %s", name)
 	return nil
 }
 
-func activateWPASupplicant(vethname string) (err error) {
+func activateWPASupplicant(univeth UniVeth, s *Server) (err error) {
 	cmd := "/sbin/wpa_supplicant"
 	conf := "/etc/wpa_supplicant/wpa_supplicant.conf"
-	err = exec.Command(cmd, "-D", "wired", "-i", vethname, "-c", conf).Start()
+	err = exec.Command(cmd, "-D", "wired", "-i", univeth.Veth, "-c", conf).Start()
+	onu, _ := s.GetOnuByID(univeth.OnuId)
 	if err != nil {
-		logger.Error("Fail to activateWPASupplicant() for :%s %v\n", vethname, err)
+		utils.LoggerWithOnu(onu).WithFields(log.Fields{
+			"err":  err,
+			"veth": univeth.Veth,
+		}).Error("Fail to activateWPASupplicant()", err)
 		return
 	}
-	logger.Info("activateWPASupplicant() for :%s\n", vethname)
+	logger.Info("activateWPASupplicant() for :%s", univeth.Veth)
 	return
 }
 
-func activateDHCPClient(vethname string) (err error) {
-	logger.Debug("activateDHCPClient() start for: %s\n", vethname)
-	cmd := exec.Command("/usr/local/bin/dhclient", vethname)
-	// if err := cmd.Run(); err != nil {
+func activateDHCPClient(univeth UniVeth, s *Server) (err error) {
+	onu, _ := s.GetOnuByID(univeth.OnuId)
+	utils.LoggerWithOnu(onu).WithFields(log.Fields{
+		"veth": univeth.Veth,
+	}).Info("activateDHCPClient() start for: %s", univeth)
+	cmd := exec.Command("/usr/local/bin/dhclient", univeth.Veth)
 	if err := cmd.Start(); err != nil {
-		logger.Error("Fail to activateDHCPClient() for: %s", vethname)
-		logger.Panic(err)
+		logger.Error("Fail to activateDHCPClient() for: %s", univeth)
+		logger.Panic("activateDHCPClient %s", err)
 	}
-	logger.Debug("activateDHCPClient() done for: %s\n", vethname)
+	logger.Debug("activateDHCPClient() done for: %s", univeth)
 	return
 }
 
 func activateDHCPServer(veth string, serverip string) error {
 	err := exec.Command("ip", "addr", "add", serverip, "dev", veth).Run()
 	if err != nil {
-		logger.Error("Fail to add ip to %s address: %s\n", veth, err)
+		logger.Error("Fail to add ip to %s address: %s", veth, err)
 		return err
 	}
 	err = exec.Command("ip", "link", "set", veth, "up").Run()
 	if err != nil {
-		logger.Error("Fail to set %s up: %s\n", veth, err)
+		logger.Error("Fail to set %s up: %s", veth, err)
 		return err
 	}
 	cmd := "/usr/local/bin/dhcpd"
 	conf := "/etc/dhcp/dhcpd.conf"
 	err = exec.Command(cmd, "-cf", conf, veth).Run()
 	if err != nil {
-		logger.Error("Fail to activateDHCP Server (): %s\n", err)
+		logger.Error("Fail to activateDHCP Server (): %s", err)
 		return err
 	}
-	logger.Info("DHCP Server is successfully activated !\n")
+	logger.Info("DHCP Server is successfully activated !")
 	return err
 }
