[VOL-5469]:VGC Logging improvment
Change-Id: I1cbc69f510f2beda2d2de5384c642985328513ef
Signed-off-by: balaji.nagarajan <balaji.nagarajan@radisys.com>
diff --git a/VERSION b/VERSION
index 1180819..699c6c6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.7
+0.1.8
diff --git a/internal/pkg/application/application.go b/internal/pkg/application/application.go
index 4f390fd..de67c02 100644
--- a/internal/pkg/application/application.go
+++ b/internal/pkg/application/application.go
@@ -2212,12 +2212,12 @@
// TriggerPendingProfileDeleteReq - trigger pending profile delete request
func (va *VoltApplication) TriggerPendingProfileDeleteReq(cntx context.Context, device string) {
- logger.Infow(ctx, "Trigger Pending Profile Delete for device", log.Fields{"Device": device})
+ logger.Debugw(ctx, "Trigger Pending Profile Delete for device", log.Fields{"Device": device})
va.TriggerPendingServiceDeactivateReq(cntx, device)
va.TriggerPendingServiceDeleteReq(cntx, device)
va.TriggerPendingVpvDeleteReq(cntx, device)
va.TriggerPendingVnetDeleteReq(cntx, device)
- logger.Infow(ctx, "All Pending Profile Delete triggered for device", log.Fields{"Device": device})
+ logger.Debugw(ctx, "All Pending Profile Delete triggered for device", log.Fields{"Device": device})
}
// TriggerPendingServiceDeactivateReq - trigger pending service deactivate request
@@ -2271,7 +2271,7 @@
// TriggerPendingVpvDeleteReq - trigger pending VPV delete request
func (va *VoltApplication) TriggerPendingVpvDeleteReq(cntx context.Context, device string) {
- logger.Infow(ctx, "Pending VPVs to be deleted", log.Fields{"Count": len(va.VoltPortVnetsToDelete)})
+ logger.Debugw(ctx, "Pending VPVs to be deleted", log.Fields{"Count": len(va.VoltPortVnetsToDelete)})
for vpv := range va.VoltPortVnetsToDelete {
if vpv.Device == device {
logger.Debugw(ctx, "Triggering Pending VPv flow delete", log.Fields{"Port": vpv.Port, "Device": vpv.Device, "Vnet": vpv.VnetName})
@@ -2282,7 +2282,7 @@
// TriggerPendingVnetDeleteReq - trigger pending vnet delete request
func (va *VoltApplication) TriggerPendingVnetDeleteReq(cntx context.Context, device string) {
- logger.Infow(ctx, "Pending Vnets to be deleted", log.Fields{"Count": len(va.VnetsToDelete)})
+ logger.Debugw(ctx, "Pending Vnets to be deleted", log.Fields{"Count": len(va.VnetsToDelete)})
for vnetName := range va.VnetsToDelete {
if vnetIntf, _ := va.VnetsByName.Load(vnetName); vnetIntf != nil {
vnet := vnetIntf.(*VoltVnet)
diff --git a/internal/pkg/application/dhcprelay.go b/internal/pkg/application/dhcprelay.go
index 354db3c..ef499bb 100644
--- a/internal/pkg/application/dhcprelay.go
+++ b/internal/pkg/application/dhcprelay.go
@@ -219,7 +219,7 @@
delete(drv.sessions, key)
delete(drv.sessionsv6, sessionKey)
drv.sessionLock.Unlock()
- logger.Infow(ctx, "DHCP Sessions deleted", log.Fields{"MAC": addr})
+ logger.Debugw(ctx, "DHCP Sessions deleted", log.Fields{"MAC": addr})
}
// AddDhcp6Session to add dhcpv6 session
@@ -389,7 +389,7 @@
duid := &layers.DHCPv6DUID{}
err := duid.DecodeFromBytes(option.Data)
if err == nil {
- logger.Infow(ctx, "ClientIdentifier", log.Fields{"DUID": duid, "Option": option.String()})
+ logger.Debugw(ctx, "ClientIdentifier", log.Fields{"DUID": duid, "Option": option.String()})
duidLen := len(option.Data)
if duidLen > 130 {
duidLen = 130
diff --git a/internal/pkg/application/meters.go b/internal/pkg/application/meters.go
index cc61a4f..1f6b41b 100644
--- a/internal/pkg/application/meters.go
+++ b/internal/pkg/application/meters.go
@@ -183,9 +183,9 @@
meter.AddBand(vm.Gir, 0)
}
- logger.Infow(ctx, "Meter Config", log.Fields{"Cir": vm.Cir, "Air": vm.Air, "Pir": vm.Pir, "Gir": vm.Gir, "Eir": vm.Eir})
- logger.Infow(ctx, "Meter Burst Config", log.Fields{"Cbs": vm.Cbs, "Pbs": vm.Pbs})
- logger.Infow(ctx, "Meter Burst Oper", log.Fields{"Pir": pir, "Pbs": pbs})
+ logger.Debugw(ctx, "Meter Config", log.Fields{"Cir": vm.Cir, "Air": vm.Air, "Pir": vm.Pir, "Gir": vm.Gir, "Eir": vm.Eir})
+ logger.Debugw(ctx, "Meter Burst Config", log.Fields{"Cbs": vm.Cbs, "Pbs": vm.Pbs})
+ logger.Debugw(ctx, "Meter Burst Oper", log.Fields{"Pir": pir, "Pbs": pbs})
// Set Air
// Air is used in place of Gir only if Gir is
// not present and Air is not 0
diff --git a/internal/pkg/application/service.go b/internal/pkg/application/service.go
index 9a771f9..3fd1a4e 100644
--- a/internal/pkg/application/service.go
+++ b/internal/pkg/application/service.go
@@ -506,6 +506,7 @@
}
vs.UsHSIAFlowsApplied = false
}
+ logger.Debugw(ctx, "Deleted HSIA US flows from DB successfully", log.Fields{"Device": vs.Device, "ServiceName": vs.Name})
vs.WriteToDb(cntx)
return nil
}
@@ -562,7 +563,7 @@
}
vs.DsHSIAFlowsApplied = false
}
- logger.Infow(ctx, "Deleted HSIA DS flows from DB successfully", log.Fields{"Device": vs.Device, "ServiceName": vs.Name})
+ logger.Debugw(ctx, "Deleted HSIA DS flows from DB successfully", log.Fields{"Device": vs.Device, "ServiceName": vs.Name})
// Post HSIA configuration success indication on message bus
vs.WriteToDb(cntx)
return nil
@@ -1105,7 +1106,7 @@
})
logger.Debugw(ctx, "Sorted Pbits", log.Fields{"Pbits": vs.Pbits})
}
- logger.Infow(ctx, "VolthService...", log.Fields{"vs": vs.Name})
+ logger.Debugw(ctx, "VolthService...", log.Fields{"vs": vs})
// The bandwidth and shaper profile combined into meter
if mmDs, err = va.GetMeter(cfg.DsMeterProfile); err == nil {
@@ -1250,7 +1251,7 @@
if vpv.IgmpEnabled {
va.ReceiverDownInd(cntx, vpv.Device, vpv.Port)
}
- logger.Infow(ctx, "Delete Service from VPV", log.Fields{"VPV_Port": vpv.Port, "VPV_SVlan": vpv.SVlan, "VPV_CVlan": vpv.CVlan, "VPV_UniVlan": vpv.UniVlan, "ServiceName": name})
+ logger.Debugw(ctx, "Delete Service from VPV", log.Fields{"VPV_Port": vpv.Port, "VPV_SVlan": vpv.SVlan, "VPV_CVlan": vpv.CVlan, "VPV_UniVlan": vpv.UniVlan, "ServiceName": name})
vpv.DelService(cntx, vs)
if vpv.servicesCount.Load() == 0 {
va.DelVnetFromPort(cntx, vs.Port, vpv)
@@ -1266,17 +1267,17 @@
}
if nil != newSvc {
- logger.Infow(ctx, "Old Service meter profiles", log.Fields{"AGG": vs.AggDsMeterProfile, "DS": vs.DsMeterProfile, "US": vs.UsMeterProfile})
- logger.Infow(ctx, "New Service meter profiles", log.Fields{"AGG": newSvc.AggDsMeterProfile, "DS": newSvc.DsMeterProfile, "US": newSvc.UsMeterProfile})
+ logger.Debugw(ctx, "Old Service meter profiles", log.Fields{"AGG": vs.AggDsMeterProfile, "DS": vs.DsMeterProfile, "US": vs.UsMeterProfile})
+ logger.Debugw(ctx, "New Service meter profiles", log.Fields{"AGG": newSvc.AggDsMeterProfile, "DS": newSvc.DsMeterProfile, "US": newSvc.UsMeterProfile})
}
- logger.Infow(ctx, "About to mark meter for deletion\n", log.Fields{"serviceName": vs.Name})
+ logger.Debugw(ctx, "About to mark meter for deletion\n", log.Fields{"serviceName": vs.Name})
if aggMeter, ok := va.MeterMgr.GetMeterByID(vs.AggDsMeterID); ok {
if nil == newSvc || (nil != newSvc && aggMeter.Name != newSvc.AggDsMeterProfile) {
if aggMeter.AssociatedServices > 0 {
aggMeter.AssociatedServices--
- logger.Infow(ctx, "Agg Meter associated services updated\n", log.Fields{"MeterID": aggMeter})
+ logger.Debugw(ctx, "Agg Meter associated services updated\n", log.Fields{"MeterID": aggMeter})
va.UpdateMeterProf(cntx, *aggMeter)
}
}
@@ -1285,7 +1286,7 @@
if nil == newSvc || (nil != newSvc && dsMeter.Name != newSvc.DsMeterProfile) {
if dsMeter.AssociatedServices > 0 {
dsMeter.AssociatedServices--
- logger.Infow(ctx, "DS Meter associated services updated\n", log.Fields{"MeterID": dsMeter})
+ logger.Debugw(ctx, "DS Meter associated services updated\n", log.Fields{"MeterID": dsMeter})
va.UpdateMeterProf(cntx, *dsMeter)
}
}
@@ -1295,7 +1296,7 @@
if nil == newSvc || (nil != newSvc && usMeter.Name != newSvc.UsMeterProfile) {
if usMeter.AssociatedServices > 0 {
usMeter.AssociatedServices--
- logger.Infow(ctx, "US Meter associated services updated\n", log.Fields{"MeterID": usMeter})
+ logger.Debugw(ctx, "US Meter associated services updated\n", log.Fields{"MeterID": usMeter})
va.UpdateMeterProf(cntx, *usMeter)
}
}
@@ -1739,7 +1740,7 @@
if vs.UsHSIAFlowsApplied {
vpv.DelTrapFlows(cntx)
vs.DelHsiaFlows(cntx)
- logger.Infow(ctx, "Remove Service Flows Triggered", log.Fields{"Service": srv, "US": vs.UsHSIAFlowsApplied, "DS": vs.DsHSIAFlowsApplied})
+ logger.Debugw(ctx, "Remove Service Flows Triggered", log.Fields{"Service": srv, "US": vs.UsHSIAFlowsApplied, "DS": vs.DsHSIAFlowsApplied})
} else {
vs.updateVnetProfile(cntx, msr.DeviceID)
}
@@ -1798,7 +1799,7 @@
// updateVnetProfile - Called on flow process completion
// Removes old service and creates new VPV & service with updated vnet profile
func (vs *VoltService) updateVnetProfile(cntx context.Context, deviceID string) {
- logger.Infow(ctx, "Update Vnet Profile Triggering", log.Fields{"Service": vs.Name, "US": vs.UsHSIAFlowsApplied, "DS": vs.DsHSIAFlowsApplied})
+ logger.Debugw(ctx, "Update Vnet Profile Triggering", log.Fields{"Service": vs.Name, "US": vs.UsHSIAFlowsApplied, "DS": vs.DsHSIAFlowsApplied})
nvs := VoltService{}
nvs.VoltServiceCfg = vs.VoltServiceCfg
@@ -1859,7 +1860,7 @@
if err := va.AddService(cntx, nvs.VoltServiceCfg, &nvs.VoltServiceOper); err != nil {
logger.Warnw(ctx, "Add New Service Failed", log.Fields{"Service": nvs.Name, "Error": err})
}
- logger.Infow(ctx, "Add New Service Triggered", log.Fields{"Service": nvs.Name, "US": nvs.UsHSIAFlowsApplied, "DS": nvs.DsHSIAFlowsApplied, "DelFlag": nvs.DeleteInProgress})
+ logger.Debugw(ctx, "Add New Service Triggered", log.Fields{"Service": nvs.Name, "US": nvs.UsHSIAFlowsApplied, "DS": nvs.DsHSIAFlowsApplied, "DelFlag": nvs.DeleteInProgress})
msr.ServicesList[oldSrvName] = true
va.updateMigrateServicesRequest(deviceID, oldVnetID, id, msr)
@@ -1895,7 +1896,7 @@
// FetchAndProcessAllMigrateServicesReq - fetch all pending migrate services req from DB and process based on provided func
func (va *VoltApplication) FetchAndProcessAllMigrateServicesReq(cntx context.Context, device string, msrAction func(context.Context, *MigrateServicesRequest)) {
- logger.Infow(ctx, "Fetch all pending migrate services req from DB and process based on provided func", log.Fields{"Device": device})
+ logger.Debugw(ctx, "Fetch all pending migrate services req from DB and process based on provided func", log.Fields{"Device": device})
msrList, _ := db.GetAllMigrateServicesReq(cntx, device)
for _, msr := range msrList {
b, ok := msr.Value.([]byte)
@@ -2202,7 +2203,7 @@
vs := value.(*VoltService)
// If svlan if provided, then the tags and tpID of service has to be matching
if sVlan != of.VlanNone && (sVlan != vs.SVlan || cVlan != vs.CVlan || tpID != vs.TechProfileID) {
- logger.Warnw(ctx, "Service Activate Request Does not match", log.Fields{"Device": deviceID, "voltService": vs})
+ logger.Debugw(ctx, "Service Activate Request Does not match", log.Fields{"Device": deviceID, "voltService": vs})
return true
}
if portNo == vs.Port && !vs.IsActivated {
@@ -2247,7 +2248,7 @@
// DeactivateService to activate pre-provisioned service
func (va *VoltApplication) DeactivateService(cntx context.Context, deviceID, portNo string, sVlan, cVlan of.VlanType, tpID uint16) error {
- logger.Debugw(ctx, "Service Deactivate Request ", log.Fields{"Device": deviceID, "Port": portNo, "Svaln": sVlan, "Cvlan": cVlan, "TpID": tpID})
+ logger.Infow(ctx, "Service Deactivate Request ", log.Fields{"Device": deviceID, "Port": portNo, "Svaln": sVlan, "Cvlan": cVlan, "TpID": tpID})
va.ServiceByName.Range(func(key, value interface{}) bool {
vs := value.(*VoltService)
diff --git a/internal/pkg/application/vnets.go b/internal/pkg/application/vnets.go
index ef60ce3..2bbcd14 100644
--- a/internal/pkg/application/vnets.go
+++ b/internal/pkg/application/vnets.go
@@ -336,7 +336,7 @@
va.storeVnetConfig(cfg, vv)
vv.WriteToDb(cntx)
- logger.Infow(ctx, "Added VNET TO DB", log.Fields{"cfg": cfg, "devicesToHandle": devicesToHandle})
+ logger.Debugw(ctx, "Added VNET TO DB", log.Fields{"cfg": cfg, "devicesToHandle": devicesToHandle})
//va.PushDevFlowForVlan(vv)
AppMutex.VnetMutex.Unlock()
@@ -345,7 +345,7 @@
// DelVnet to delete a VNET from the list of VNETs configured
func (va *VoltApplication) DelVnet(cntx context.Context, name, deviceSerialNum string) error {
- logger.Infow(ctx, "Deleting Vnet", log.Fields{"Vnet": name})
+ logger.Debugw(ctx, "Deleting Vnet", log.Fields{"Vnet": name})
AppMutex.VnetMutex.Lock()
if vnetIntf, ok := va.VnetsByName.Load(name); ok {
vnet := vnetIntf.(*VoltVnet)
@@ -546,15 +546,13 @@
// TODO - Nav - Temp
func (vpv *VoltPortVnet) printAssociatedVPVs(add bool) {
- logger.Infow(ctx, "Start----Printing all associated VPV", log.Fields{"Device": vpv.Device, "Add": add})
if vMap := GetApplication().GetAssociatedVpvsForDevice(vpv.Device, vpv.SVlan); vMap != nil {
vMap.Range(func(key, value interface{}) bool {
vpvEntry := key.(*VoltPortVnet)
- logger.Infow(ctx, "Associated VPVs", log.Fields{"SVlan": vpvEntry.SVlan, "CVlan": vpvEntry.CVlan, "UniVlan": vpvEntry.UniVlan})
+ logger.Debugw(ctx, "Associated VPVs", log.Fields{"Device": vpv.Device, "Add": add, "SVlan": vpvEntry.SVlan, "CVlan": vpvEntry.CVlan, "UniVlan": vpvEntry.UniVlan})
return true
})
}
- logger.Infow(ctx, "End----Printing all associated VPV", log.Fields{"Device": vpv.Device, "Add": add})
}
// GetCircuitID : The interface to be satisfied by the VoltPortVnet to be a DHCP relay
@@ -702,7 +700,7 @@
case layers.DHCPOptLeaseTime:
leasetime := GetIPv4LeaseTime(o)
vpv.DhcpExpiryTime = time.Now().Add((time.Duration(leasetime) * time.Second))
- logger.Infow(ctx, "Lease Expiry Set", log.Fields{"Time": vpv.DhcpExpiryTime})
+ logger.Debugw(ctx, "Lease Expiry Set", log.Fields{"Time": vpv.DhcpExpiryTime})
}
}
}
@@ -724,7 +722,7 @@
// AddSvcUsMeterToDevice to add service upstream meter info to device
func AddSvcUsMeterToDevice(cntx context.Context, key, value interface{}, flag bool) bool {
svc := value.(*VoltService)
- logger.Infow(ctx, "Adding upstream meter profile to device", log.Fields{"ServiceName": svc.Name})
+ logger.Debugw(ctx, "Adding upstream meter profile to device", log.Fields{"ServiceName": svc.Name})
if device, _ := GetApplication().GetDeviceFromPort(svc.Port); device != nil {
GetApplication().AddMeterToDevice(svc.Port, device.Name, svc.UsMeterID, 0)
return true
@@ -816,7 +814,7 @@
// plausible case, the MAC address can be learnt from N:1 without DHCP
// relay by configuring any unknown MAC address to be reported. This
// however is not seen as a real use case.
- logger.Infow(ctx, "Port Up - Service Flows", log.Fields{"Device": device.Name, "Port": port})
+ logger.Debugw(ctx, "Port Up - Service Flows", log.Fields{"Device": device.Name, "Port": port})
if !vpv.McastService {
vpv.RangeOnServices(cntx, AddUsHsiaFlows, false)
}
@@ -828,7 +826,7 @@
// Process IGMP proxy - install IGMP trap rules before DHCP trap rules
if vpv.IgmpEnabled {
- logger.Infow(ctx, "Port Up - IGMP Flows", log.Fields{"Device": device.Name, "Port": port})
+ logger.Debugw(ctx, "Port Up - IGMP Flows", log.Fields{"Device": device.Name, "Port": port})
vpv.RangeOnServices(cntx, AddSvcUsMeterToDevice, false)
if err := vpv.AddIgmpFlows(cntx); err != nil {
statusCode, statusMessage := errorCodes.GetErrorInfo(err)
@@ -1046,7 +1044,7 @@
// AddSvc adds a service on the VNET on a port. The addition is
// triggered when NB requests for service addition
func (vpv *VoltPortVnet) AddSvc(cntx context.Context, svc *VoltService) {
- logger.Infow(ctx, "Add Service to VPV", log.Fields{"ServiceName": svc.Name})
+ logger.Debugw(ctx, "Add Service to VPV", log.Fields{"ServiceName": svc.Name})
//vpv.services = append(vpv.services, svc)
vpv.AddService(cntx, svc)
logger.Debugw(ctx, "Added Service to VPV", log.Fields{"Num of SVCs": vpv.servicesCount.Load(), "SVC": svc})
@@ -1145,7 +1143,7 @@
// When already the port is UP and provisioned a service without igmp, then trap flows for subsequent
// service with Igmp Enabled needs to be installed
if svc.IgmpEnabled && vpv.FlowsApplied {
- logger.Infow(ctx, "Add Service - IGMP Flows", log.Fields{"Device": vpv.Device, "Port": vpv.Port})
+ logger.Debugw(ctx, "Add Service - IGMP Flows", log.Fields{"Device": vpv.Device, "Port": vpv.Port})
if err := vpv.AddIgmpFlows(cntx); err != nil {
statusCode, statusMessage := errorCodes.GetErrorInfo(err)
vpv.FlowInstallFailure("VGC processing failure", statusCode, statusMessage)
@@ -1288,7 +1286,7 @@
statusCode, statusMessage := errorCodes.GetErrorInfo(err)
vpv.FlowInstallFailure("VGC processing failure", statusCode, statusMessage)
}
- logger.Infow(ctx, "ICMPv6 MC Group modification will not be triggered to rwcore for ",
+ logger.Debugw(ctx, "ICMPv6 MC Group modification will not be triggered to rwcore for ",
log.Fields{"port": vpv.Port})
//vpv.updateICMPv6McGroup(true)
} else if vpv.ArpRelay {
@@ -2432,7 +2430,7 @@
// AddVnetToPort to add vnet to port
func (va *VoltApplication) AddVnetToPort(cntx context.Context, port string, vvnet *VoltVnet, vs *VoltService) *VoltPortVnet {
// The VNET is not on the port and is to be added
- logger.Debugw(ctx, "Adding VNET to Port", log.Fields{"Port": port, "VNET": vvnet.Name})
+ logger.Infow(ctx, "Adding VNET to Port", log.Fields{"Port": port, "VNET": vvnet.Name})
vpv := NewVoltPortVnet(vvnet)
vpv.MacLearning = vvnet.MacLearning
vpv.Port = port
@@ -2705,7 +2703,7 @@
vnetList := vnetListIntf.(*util.ConcurrentMap)
vnetList.Set(vnet.Name, true)
device.ConfiguredVlanForDeviceFlows.Set(VnetKey(vnet.SVlan, vnet.CVlan, 0), vnetList)
- logger.Infow(ctx, "Flow already pushed for these Vlans. Adding profile to list", log.Fields{"SVlan": vnet.SVlan, "CVlan": vnet.CVlan, "vnetList-len": vnetList.Length()})
+ logger.Debugw(ctx, "Flow already pushed for these Vlans. Adding profile to list", log.Fields{"SVlan": vnet.SVlan, "CVlan": vnet.CVlan, "vnetList-len": vnetList.Length()})
return true
}
logger.Debugw(ctx, "Configuring Dev Flows Group for device ", log.Fields{"Device": device})
@@ -2732,7 +2730,7 @@
logger.Warnw(ctx, "Configuring ICMPv6 Flow for device failed ", log.Fields{"Device": device.Name, "err": err})
return true
}
- logger.Infow(ctx, "ICMPv6 Flow Added to Queue", log.Fields{"flow": flow})
+ logger.Debugw(ctx, "ICMPv6 Flow Added to Queue", log.Fields{"flow": flow})
// Pushing ARP Flow
flow = BuildDSArpFlow(portID, vnet)
@@ -2741,7 +2739,7 @@
logger.Warnw(ctx, "Configuring ARP Flow for device failed ", log.Fields{"Device": device.Name, "err": err})
return true
}
- logger.Infow(ctx, "ARP Flow Added to Queue", log.Fields{"flow": flow})
+ logger.Debugw(ctx, "ARP Flow Added to Queue", log.Fields{"flow": flow})
vnetList := util.NewConcurrentMap()
vnetList.Set(vnet.Name, true)
@@ -2962,14 +2960,14 @@
if err := vnet.RemoveFlows(cntx, device, flow); err != nil {
logger.Warnw(ctx, "Delete Flow Failed", log.Fields{"Device": device, "Flow": flow, "Error": err})
}
- logger.Infow(ctx, "ICMP Flow Delete Added to Queue", log.Fields{"flow": flow})
+ logger.Debugw(ctx, "ICMP Flow Delete Added to Queue", log.Fields{"flow": flow})
flow = BuildDSArpFlow(portID, vnet)
flow.ForceAction = true
if err := vnet.RemoveFlows(cntx, device, flow); err != nil {
logger.Warnw(ctx, "Delete Flow Failed", log.Fields{"Device": device, "Flow": flow, "Error": err})
}
- logger.Infow(ctx, "ARP Flow Delete Added to Queue", log.Fields{"flow": flow})
+ logger.Debugw(ctx, "ARP Flow Delete Added to Queue", log.Fields{"flow": flow})
device.ConfiguredVlanForDeviceFlows.Remove(VnetKey(vnet.SVlan, vnet.CVlan, 0))
}
return false
@@ -3173,7 +3171,7 @@
if len(vpv.PendingDeleteFlow) == 0 && !vpv.FlowsApplied {
logger.Debugw(ctx, "All Flows removed for VPV. Triggering VPV Deletion from DB", log.Fields{"VPV Port": vpv.Port, "Device": vpv.Device, "Vnet": vpv.VnetName})
vpv.DelFromDb(cntx)
- logger.Infow(ctx, "Deleted VPV from DB/Cache successfully", log.Fields{"VPV Port": vpv.Port, "Device": vpv.Device, "Vnet": vpv.VnetName})
+ logger.Debugw(ctx, "Deleted VPV from DB/Cache successfully", log.Fields{"VPV Port": vpv.Port, "Device": vpv.Device, "Vnet": vpv.VnetName})
}
}
@@ -3257,7 +3255,7 @@
logger.Warnw(ctx, "Deleting Vnet : All flows removed", log.Fields{"Name": vv.Name, "AssociatedPorts": vv.AssociatedPorts, "Device": device})
GetApplication().deleteVnetConfig(vv)
_ = db.DelVnet(cntx, vv.Name)
- logger.Infow(ctx, "Deleted Vnet from DB/Cache successfully", log.Fields{"Device": device, "Vnet": vv.Name})
+ logger.Debugw(ctx, "Deleted Vnet from DB/Cache successfully", log.Fields{"Device": device, "Vnet": vv.Name})
} else {
logger.Warnw(ctx, "Skipping Del Vnet", log.Fields{"Name": vv.Name, "AssociatedPorts": vv.AssociatedPorts, "PendingDelFlows": vv.PendingDeleteFlow[device]})
}
diff --git a/internal/pkg/controller/audittables.go b/internal/pkg/controller/audittables.go
index 0be505a..d98888c 100644
--- a/internal/pkg/controller/audittables.go
+++ b/internal/pkg/controller/audittables.go
@@ -161,7 +161,7 @@
} else {
// The flow exists at the controller but not at the device
// Push the flow to the device
- logger.Debugw(ctx, "Adding Meter To Missing Meters", log.Fields{"Id": meter.ID})
+ logger.Infow(ctx, "Adding Meter To Missing Meters", log.Fields{"Id": meter.ID})
missingMeters = append(missingMeters, meter)
}
}
diff --git a/internal/pkg/controller/controller.go b/internal/pkg/controller/controller.go
index 65b435e..1c02738 100644
--- a/internal/pkg/controller/controller.go
+++ b/internal/pkg/controller/controller.go
@@ -169,7 +169,7 @@
taskQueue = taskQueueIntf.(*tasks.Tasks)
}
taskQueue.AddTask(task)
- logger.Warnw(ctx, "Task Added to Controller Task List", log.Fields{"Len": taskQueue.NumPendingTasks(), "Total": taskQueue.TotalTasks()})
+ logger.Debugw(ctx, "Task Added to Controller Task List", log.Fields{"Len": taskQueue.NumPendingTasks(), "Total": taskQueue.TotalTasks()})
}
// AddNewDevice - called when new device is discovered. This will be
@@ -400,7 +400,7 @@
if delFlowsOnlyInDevice {
for cookie, subFlow := range flow.SubFlows {
err := d.DelFlow(ctx, subFlow)
- logger.Infow(ctx, "Flow Deleted from device/DB", log.Fields{"Cookie": cookie, "Device": device, "Port": port, "Error": err})
+ logger.Debugw(ctx, "Flow Deleted from device/DB", log.Fields{"Cookie": cookie, "Device": device, "Port": port, "Error": err})
}
} else {
flow.Command = of.CommandDel
diff --git a/internal/pkg/controller/device.go b/internal/pkg/controller/device.go
index 497339b..73fc348 100644
--- a/internal/pkg/controller/device.go
+++ b/internal/pkg/controller/device.go
@@ -365,7 +365,7 @@
// RestoreGroupsFromDb - restores all groups from DB
func (d *Device) RestoreGroupsFromDb(cntx context.Context) {
- logger.Info(ctx, "Restoring Groups")
+ logger.Debug(ctx, "Restoring Groups")
groups, _ := db.GetGroups(cntx, d.ID)
for _, group := range groups {
b, ok := group.Value.([]byte)
@@ -520,7 +520,7 @@
if p == nil {
return errors.New("unknown port")
} else {
- logger.Infow(ctx, "Found port by name", log.Fields{"PortName": p.Name, "PortID": p.ID})
+ logger.Debugw(ctx, "Found port by name", log.Fields{"PortName": p.Name, "PortID": p.ID})
}
}
if p.State == PortStateUp {
@@ -785,7 +785,7 @@
for _, port := range d.PortsByID {
if port.State != PortStateDown {
- logger.Infow(ctx, "Resetting Port State to DOWN", log.Fields{"Device": d.ID, "Port": port})
+ logger.Debugw(ctx, "Resetting Port State to DOWN", log.Fields{"Device": d.ID, "Port": port})
GetController().PortDownInd(cntx, d.ID, port.Name)
port.State = PortStateDown
d.WritePortToDb(cntx, port)
@@ -844,7 +844,7 @@
return
}
if p := d.GetPortByID(port); p != nil {
- logger.Infow(ctx, "Port State Processing", log.Fields{"Received": state, "Current": p.State})
+ logger.Infow(ctx, "Port State Processing", log.Fields{"Received": state, "Current": p.State, "port": port, "portName": portName, "Device": d.ID})
if p.Name != portName {
logger.Warnw(ctx, "Dropping Port State processing: Port name does not match", log.Fields{"vgcPort": p.Name, "ofpPort": portName, "ID": port})
@@ -856,13 +856,13 @@
p.Tasks.CheckAndInitialize(d.ctx)
if state == uint32(ofp.OfpPortState_OFPPS_LIVE) && p.State == PortStateDown {
// Transition from DOWN to UP
- logger.Infow(ctx, "Port State Change to UP", log.Fields{"Device": d.ID, "Port": port})
+ logger.Debugw(ctx, "Port State Change to UP", log.Fields{"Device": d.ID, "Port": port})
GetController().PortUpInd(cntx, d.ID, p.Name)
p.State = PortStateUp
d.WritePortToDb(cntx, p)
} else if (state != uint32(ofp.OfpPortState_OFPPS_LIVE)) && (p.State != PortStateDown) {
// Transition from UP to Down
- logger.Infow(ctx, "Port State Change to Down", log.Fields{"Device": d.ID, "Port": port})
+ logger.Debugw(ctx, "Port State Change to Down", log.Fields{"Device": d.ID, "Port": port})
GetController().PortDownInd(cntx, d.ID, p.Name)
p.State = PortStateDown
d.WritePortToDb(cntx, p)
@@ -879,13 +879,13 @@
return
}
if p := d.GetPortByID(port); p != nil {
- logger.Infow(ctx, "Port State Processing after Reboot", log.Fields{"Received": state, "Current": p.State})
+ logger.Infow(ctx, "Port State Processing after Reboot", log.Fields{"Received": state, "Current": p.State, "port": port, "Device": d.ID})
p.Tasks.Initialize(d.ctx)
if p.State == PortStateUp {
- logger.Infow(ctx, "Port State: UP", log.Fields{"Device": d.ID, "Port": port})
+ logger.Debugw(ctx, "Port State: UP", log.Fields{"Device": d.ID, "Port": port})
GetController().PortUpInd(cntx, d.ID, p.Name)
} else if p.State == PortStateDown {
- logger.Infow(ctx, "Port State: Down", log.Fields{"Device": d.ID, "Port": port})
+ logger.Debugw(ctx, "Port State: Down", log.Fields{"Device": d.ID, "Port": port})
GetController().PortDownInd(cntx, d.ID, p.Name)
}
}
diff --git a/voltha-go-controller/onos_nbi/deviceconfig.go b/voltha-go-controller/onos_nbi/deviceconfig.go
index c273ae2..949b447 100644
--- a/voltha-go-controller/onos_nbi/deviceconfig.go
+++ b/voltha-go-controller/onos_nbi/deviceconfig.go
@@ -54,7 +54,7 @@
}
func (oh *DeviceConfigHandle) AddDeviceConfig(cntx context.Context, w http.ResponseWriter, r *http.Request) {
- logger.Info(cntx, "Inside AddDeviceConfig method")
+ logger.Debug(cntx, "Inside AddDeviceConfig method")
// Get the payload to process the request
d := new(bytes.Buffer)
if _, err := d.ReadFrom(r.Body); err != nil {