Commit 39502c9c3f for frr

commit 39502c9c3f79f44b4a9e0cbf771411a7959eace0
Author: Donald Sharp <sharpd@nvidia.com>
Date:   Tue Oct 20 11:09:05 2026 -0400

    pimd: Standardize (S,G) string output, sg_str, in debugs

    The pim_ifchannel, pim_upstream, pim_vxlan_sg and pim_msdp_sa
    structures keep a preformatted "(S,G)" string in sg_str.  This
    string is used in the debugs without any vrf information
    associated with it.  This has the same issues as the debugs
    using %pSG.

    Solidify on "(%s:%u:%u)%s", vrf_name, vrf_id, table_id, sg_str
    for the zlog_XXX and flog_XXX calls so the output is consistent
    with the %pSG debugs and very easy to grep.

    Signed-off-by: Donald Sharp <sharpd@nvidia.com>

diff --git a/pimd/pim_assert.c b/pimd/pim_assert.c
index 39191fea16..f5e6ea352e 100644
--- a/pimd/pim_assert.c
+++ b/pimd/pim_assert.c
@@ -46,19 +46,16 @@ void pim_ifassert_winner_set(struct pim_ifchannel *ch,

 	if (PIM_DEBUG_PIM_EVENTS) {
 		if (ch->ifassert_state != new_state) {
-			zlog_debug(
-				"%s: (S,G)=%s assert state changed from %s to %s on interface %s",
-				__func__, ch->sg_str,
-				pim_ifchannel_ifassert_name(ch->ifassert_state),
-				pim_ifchannel_ifassert_name(new_state),
-				ch->interface->name);
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s assert state changed from %s to %s on interface %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   pim_ifchannel_ifassert_name(ch->ifassert_state),
+				   pim_ifchannel_ifassert_name(new_state), ch->interface->name);
 		}

 		if (winner_changed)
-			zlog_debug(
-				"%s: (S,G)=%s assert winner changed from %pPAs to %pPAs on interface %s",
-				__func__, ch->sg_str, &ch->ifassert_winner,
-				&winner, ch->interface->name);
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s assert winner changed from %pPAs to %pPAs on interface %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   &ch->ifassert_winner, &winner, ch->interface->name);
 	} /* PIM_DEBUG_PIM_EVENTS */

 	ch->ifassert_state = new_state;
@@ -131,10 +128,9 @@ static void if_could_assert_do_a1(const char *caller, struct pim_ifchannel *ch)
 {
 	if (PIM_IF_FLAG_TEST_COULD_ASSERT(ch->flags)) {
 		if (assert_action_a1(ch)) {
-			zlog_warn(
-				"%s: %s: (S,G)=%s assert_action_a1 failure on interface %s",
-				__func__, caller, ch->sg_str,
-				ch->interface->name);
+			zlog_warn("%s: %s: (S,G)=(%s:%u:%u)%s assert_action_a1 failure on interface %s",
+				  __func__, caller, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				  ch->interface->name);
 			/* log warning only */
 		}
 	}
@@ -206,9 +202,9 @@ static int dispatch_assert(struct interface *ifp, pim_addr source_addr,
 		}
 		break;
 	default: {
-		zlog_warn(
-			"%s: (S,G)=%s invalid assert state %d on interface %s",
-			__func__, ch->sg_str, ch->ifassert_state, ifp->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s invalid assert state %d on interface %s",
+			  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+			  ch->ifassert_state, ifp->name);
 	}
 		return -2;
 	}
@@ -422,16 +418,16 @@ static int pim_assert_do(struct pim_ifchannel *ch,
 	ifp = ch->interface;
 	if (!ifp) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: channel%s has no associated interface!",
-				   __func__, ch->sg_str);
+			zlog_debug("%s: channel(%s:%u:%u)%s has no associated interface!",
+				   __func__, "UNKNOWN", VRF_UNKNOWN, 0, ch->sg_str);
 		return -1;
 	}
 	pim_ifp = ifp->info;
 	if (!pim_ifp) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: channel %s pim not enabled on interface: %s",
-				__func__, ch->sg_str, ifp->name);
+			zlog_debug("%s: channel (%s:%u:%u)%s pim not enabled on interface: %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ifp->name);
 		return -1;
 	}

@@ -458,8 +454,8 @@ static int pim_assert_do(struct pim_ifchannel *ch,
 	pim_hello_require(ifp);

 	if (PIM_DEBUG_PIM_TRACE) {
-		zlog_debug("%s: to %s: (S,G)=%s pref=%u metric=%u rpt_bit=%u",
-			   __func__, ifp->name, ch->sg_str,
+		zlog_debug("%s: to %s: (S,G)=(%s:%u:%u)%s pref=%u metric=%u rpt_bit=%u", __func__,
+			   ifp->name, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
 			   metric.metric_preference, metric.route_metric,
 			   PIM_FORCE_BOOLEAN(metric.rpt_bit_flag));
 	}
@@ -510,8 +506,8 @@ static void on_assert_timer(struct event *t)
 	ifp = ch->interface;

 	if (PIM_DEBUG_PIM_TRACE) {
-		zlog_debug("%s: (S,G)=%s timer expired on interface %s",
-			   __func__, ch->sg_str, ifp->name);
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s timer expired on interface %s", __func__,
+			   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ifp->name);
 	}

 	switch (ch->ifassert_state) {
@@ -523,10 +519,9 @@ static void on_assert_timer(struct event *t)
 		break;
 	case PIM_IFASSERT_NOINFO: {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: (S,G)=%s invalid assert state %d on interface %s",
-				__func__, ch->sg_str, ch->ifassert_state,
-				ifp->name);
+			zlog_warn("%s: (S,G)=(%s:%u:%u)%s invalid assert state %d on interface %s",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				  ch->ifassert_state, ifp->name);
 	}
 	}
 }
@@ -535,9 +530,9 @@ static void assert_timer_off(struct pim_ifchannel *ch)
 {
 	if (PIM_DEBUG_PIM_TRACE) {
 		if (event_is_scheduled(ch->t_ifassert_timer)) {
-			zlog_debug(
-				"%s: (S,G)=%s cancelling timer on interface %s",
-				__func__, ch->sg_str, ch->interface->name);
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s cancelling timer on interface %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ch->interface->name);
 		}
 	}
 	event_cancel(&ch->t_ifassert_timer);
@@ -548,8 +543,9 @@ static void pim_assert_timer_set(struct pim_ifchannel *ch, int interval)
 	assert_timer_off(ch);

 	if (PIM_DEBUG_PIM_TRACE) {
-		zlog_debug("%s: (S,G)=%s starting %ums timer on interface %s", __func__,
-			   ch->sg_str, interval, ch->interface->name);
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s starting %ums timer on interface %s", __func__,
+			   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, interval,
+			   ch->interface->name);
 	}

 	event_add_timer(router->master, on_assert_timer, ch, interval,
@@ -585,8 +581,8 @@ int assert_action_a1(struct pim_ifchannel *ch)

 	pim_ifp = ifp->info;
 	if (!pim_ifp) {
-		zlog_warn("%s: (S,G)=%s multicast not enabled on interface %s",
-			  __func__, ch->sg_str, ifp->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s multicast not enabled on interface %s", __func__,
+			  PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ifp->name);
 		return -1; /* must return since pim_ifp is used below */
 	}

@@ -597,17 +593,15 @@ int assert_action_a1(struct pim_ifchannel *ch)
 					    pim_ifp->primary_address));

 	if (assert_action_a3(ch)) {
-		zlog_warn(
-			"%s: (S,G)=%s assert_action_a3 failure on interface %s",
-			__func__, ch->sg_str, ifp->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s assert_action_a3 failure on interface %s",
+			  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ifp->name);
 		/* warning only */
 	}

 	if (ch->ifassert_state != PIM_IFASSERT_I_AM_WINNER) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: channel%s not in expected PIM_IFASSERT_I_AM_WINNER state",
-				__func__, ch->sg_str);
+			zlog_warn("%s: channel(%s:%u:%u)%s not in expected PIM_IFASSERT_I_AM_WINNER state",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);
 	}

 	return 0;
@@ -634,9 +628,8 @@ static void assert_action_a2(struct pim_ifchannel *ch,

 	if (ch->ifassert_state != PIM_IFASSERT_I_AM_LOSER) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: channel%s not in expected PIM_IFASSERT_I_AM_LOSER state",
-				__func__, ch->sg_str);
+			zlog_warn("%s: channel(%s:%u:%u)%s not in expected PIM_IFASSERT_I_AM_LOSER state",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);
 	}
 }

@@ -652,17 +645,16 @@ static int assert_action_a3(struct pim_ifchannel *ch)
 {
 	if (ch->ifassert_state != PIM_IFASSERT_I_AM_WINNER) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: channel%s expected to be in PIM_IFASSERT_I_AM_WINNER state",
-				__func__, ch->sg_str);
+			zlog_warn("%s: channel(%s:%u:%u)%s expected to be in PIM_IFASSERT_I_AM_WINNER state",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);
 		return -1;
 	}

 	pim_assert_timer_reset(ch);

 	if (pim_assert_send(ch)) {
-		zlog_warn("%s: (S,G)=%s failure sending assert on interface %s",
-			  __func__, ch->sg_str, ch->interface->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s failure sending assert on interface %s", __func__,
+			  PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ch->interface->name);
 		return -1;
 	}

@@ -682,8 +674,8 @@ static int assert_action_a3(struct pim_ifchannel *ch)
 void assert_action_a4(struct pim_ifchannel *ch)
 {
 	if (pim_assert_cancel(ch)) {
-		zlog_warn("%s: failure sending AssertCancel%s on interface %s",
-			  __func__, ch->sg_str, ch->interface->name);
+		zlog_warn("%s: failure sending AssertCancel(%s:%u:%u)%s on interface %s", __func__,
+			  PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ch->interface->name);
 		/* log warning only */
 	}

@@ -691,9 +683,8 @@ void assert_action_a4(struct pim_ifchannel *ch)

 	if (ch->ifassert_state != PIM_IFASSERT_NOINFO) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: channel%s not in PIM_IFASSERT_NOINFO state as expected",
-				__func__, ch->sg_str);
+			zlog_warn("%s: channel(%s:%u:%u)%s not in PIM_IFASSERT_NOINFO state as expected",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);
 	}
 }

@@ -710,9 +701,8 @@ void assert_action_a5(struct pim_ifchannel *ch)
 	reset_ifassert_state(ch);
 	if (ch->ifassert_state != PIM_IFASSERT_NOINFO) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: channel%s not in PIM_IFSSERT_NOINFO state as expected",
-				__func__, ch->sg_str);
+			zlog_warn("%s: channel(%s:%u:%u)%s not in PIM_IFSSERT_NOINFO state as expected",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);
 	}
 }

@@ -742,8 +732,7 @@ static void assert_action_a6(struct pim_ifchannel *ch,

 	if (ch->ifassert_state != PIM_IFASSERT_I_AM_LOSER) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_warn(
-				"%s: channel%s not in PIM_IFASSERT_I_AM_LOSER state as expected",
-				__func__, ch->sg_str);
+			zlog_warn("%s: channel(%s:%u:%u)%s not in PIM_IFASSERT_I_AM_LOSER state as expected",
+				  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);
 	}
 }
diff --git a/pimd/pim_dm.c b/pimd/pim_dm.c
index fa12760e65..a7f57b1b12 100644
--- a/pimd/pim_dm.c
+++ b/pimd/pim_dm.c
@@ -152,22 +152,25 @@ static void pim_dm_assert_wrongif(struct interface *ifp, pim_sgaddr sg, struct p
 	/* CouldAssert(S,G,I) must be true to initiate Assert (RFC 3973 4.6.4) */
 	if (!PIM_IF_FLAG_TEST_COULD_ASSERT(ch->flags)) {
 		if (PIM_DEBUG_MROUTE)
-			zlog_debug("%s: (S,G)=%s CouldAssert false on %s, skipping assert",
-				   __func__, ch->sg_str, ifp->name);
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s CouldAssert false on %s, skipping assert",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ifp->name);
 		return;
 	}

 	if (ch->ifassert_state != PIM_IFASSERT_NOINFO) {
 		if (PIM_DEBUG_MROUTE)
-			zlog_debug("%s: (S,G)=%s assert state %d on %s, skipping assert_action_a1",
-				   __func__, ch->sg_str, ch->ifassert_state, ifp->name);
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s assert state %d on %s, skipping assert_action_a1",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ch->ifassert_state, ifp->name);
 		return;
 	}

 	if (assert_action_a1(ch)) {
 		if (PIM_DEBUG_MROUTE)
-			zlog_debug("%s: (S,G)=%s assert_action_a1 failure on %s", __func__,
-				   ch->sg_str, ifp->name);
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s assert_action_a1 failure on %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ifp->name);
 	}
 }

@@ -288,8 +291,9 @@ void pim_dm_assert_state_changed(struct pim_ifchannel *ch, enum pim_ifassert_sta
 			rpf.source_nexthop.interface = ifp;
 			rpf.source_nexthop.mrib_nexthop_addr = ch->ifassert_winner;
 			if (PIM_DEBUG_PIM_J_P)
-				zlog_debug("%s: (S,G)=%s Assert loser on %s, pruning winner %pPA",
-					   __func__, ch->sg_str, ifp->name, &ch->ifassert_winner);
+				zlog_debug("%s: (S,G)=(%s:%u:%u)%s Assert loser on %s, pruning winner %pPA",
+					   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+					   ifp->name, &ch->ifassert_winner);
 			pim_dm_prune_send(rpf, up, 0);
 		}
 	} else if (new_state == PIM_IFASSERT_NOINFO) {
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index d5d72c0bc5..f87d67f4fd 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -122,13 +122,13 @@ void pim_ifchannel_delete(struct pim_ifchannel *origch)
 	up = origch->upstream;

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: ifchannel entry %s(%s) del start", __func__, origch->sg_str,
-			   ifp->name);
+		zlog_debug("%s: ifchannel entry (%s:%u:%u)%s(%s) del start", __func__,
+			   PIM_DEBUG_VRF(origch->interface->vrf), origch->sg_str, ifp->name);

 	if (PIM_I_am_DualActive(pim_ifp)) {
 		if (PIM_DEBUG_MLAG)
-			zlog_debug("%s: if-chnanel-%s is deleted from a Dual active Interface",
-				   __func__, origch->sg_str);
+			zlog_debug("%s: if-chnanel-(%s:%u:%u)%s is deleted from a Dual active Interface",
+				   __func__, PIM_DEBUG_VRF(origch->interface->vrf), origch->sg_str);
 		/* Post Delete only if it is the last Dual-active Interface */
 		if (up->dualactive_ifchannel_count == 1) {
 			pim_mlag_up_local_del(pim_ifp->pim, up);
@@ -198,8 +198,9 @@ void pim_ifchannel_delete(struct pim_ifchannel *origch)

 	else {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: Avoiding deletion of upstream with ref_count %d from ifchannel(%s): %s",
-				   __func__, up->ref_count, ifp->name, origch->sg_str);
+			zlog_debug("%s: Avoiding deletion of upstream with ref_count %d from ifchannel(%s): (%s:%u:%u)%s",
+				   __func__, up->ref_count, ifp->name,
+				   PIM_DEBUG_VRF(origch->interface->vrf), origch->sg_str);
 	}

 	origch->upstream = NULL;
@@ -216,8 +217,8 @@ void pim_ifchannel_delete(struct pim_ifchannel *origch)
 	RB_REMOVE(pim_ifchannel_rb, &pim_ifp->ifchannel_rb, origch);

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: ifchannel entry %s(%s) is deleted ", __func__, origch->sg_str,
-			   ifp->name);
+		zlog_debug("%s: ifchannel entry (%s:%u:%u)%s(%s) is deleted ", __func__,
+			   PIM_DEBUG_VRF(origch->interface->vrf), origch->sg_str, ifp->name);

 #if PIM_IPV == 6
 	/* Embedded RPs learned via PIM join/connected source are freed here */
@@ -270,8 +271,9 @@ void pim_ifchannel_ifjoin_switch(const char *caller, struct pim_ifchannel *ch,
 	struct pim_ifchannel *child_ch;

 	if (PIM_DEBUG_PIM_EVENTS)
-		zlog_debug("PIM_IFCHANNEL(%s): %s is switching from %s to %s", ch->interface->name,
-			   ch->sg_str, pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->sg_rpt),
+		zlog_debug("PIM_IFCHANNEL(%s): (%s:%u:%u)%s is switching from %s to %s",
+			   ch->interface->name, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+			   pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->sg_rpt),
 			   pim_ifchannel_ifjoin_name(new_state, false));


@@ -298,11 +300,11 @@ void pim_ifchannel_ifjoin_switch(const char *caller, struct pim_ifchannel *ch,
 						child->channel_oil;

 					if (PIM_DEBUG_PIM_TRACE)
-						zlog_debug(
-							"%s %s: Prune(S,G)=%s from %s",
-							__FILE__, __func__,
-							child->sg_str,
-							up->sg_str);
+						zlog_debug("%s %s: Prune(S,G)=(%s:%u:%u)%s from (%s:%u:%u)%s",
+							   __FILE__, __func__,
+							   PIM_DEBUG_VRF(child->pim->vrf),
+							   child->sg_str,
+							   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 					if (!c_oil)
 						continue;

@@ -325,11 +327,11 @@ void pim_ifchannel_ifjoin_switch(const char *caller, struct pim_ifchannel *ch,
 					struct pim_ifchannel *child_chrpt;

 					if (PIM_DEBUG_PIM_TRACE)
-						zlog_debug(
-							"%s %s: Join(S,G)=%s from %s",
-							__FILE__, __func__,
-							child->sg_str,
-							up->sg_str);
+						zlog_debug("%s %s: Join(S,G)=(%s:%u:%u)%s from (%s:%u:%u)%s",
+							   __FILE__, __func__,
+							   PIM_DEBUG_VRF(child->pim->vrf),
+							   child->sg_str,
+							   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 					/* check if the channel can be
 					 * inherited into the SG's OIL
@@ -356,10 +358,10 @@ void pim_ifchannel_ifjoin_switch(const char *caller, struct pim_ifchannel *ch,
 	    || (new_state == PIM_IFJOIN_NOINFO)) {

 		if (PIM_DEBUG_PIM_EVENTS) {
-			zlog_debug("PIM_IFCHANNEL_%s: (S,G)=%s on interface %s",
-				   ((new_state == PIM_IFJOIN_NOINFO) ? "DOWN"
-								     : "UP"),
-				   ch->sg_str, ch->interface->name);
+			zlog_debug("PIM_IFCHANNEL_%s: (S,G)=(%s:%u:%u)%s on interface %s",
+				   ((new_state == PIM_IFJOIN_NOINFO) ? "DOWN" : "UP"),
+				   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ch->interface->name);
 		}

 		/* pim_upstream_update_join_desired looks at up->channel_oil,
@@ -478,10 +480,9 @@ static void ifmembership_set(struct pim_ifchannel *ch,
 		return;

 	if (PIM_DEBUG_PIM_EVENTS) {
-		zlog_debug("%s: (S,G)=%s membership now is %s on interface %s",
-			   __func__, ch->sg_str,
-			   membership == PIM_IFMEMBERSHIP_INCLUDE ? "INCLUDE"
-								  : "NOINFO",
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s membership now is %s on interface %s", __func__,
+			   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+			   membership == PIM_IFMEMBERSHIP_INCLUDE ? "INCLUDE" : "NOINFO",
 			   ch->interface->name);
 	}

@@ -645,10 +646,9 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, pim_sgaddr *sg,
 			pim_mlag_up_local_add(pim_ifp->pim, up);
 		}
 		if (PIM_DEBUG_MLAG)
-			zlog_debug(
-				"%s: New Dual active if-chnanel is added to upstream:%s count:%d, flags:0x%x",
-				__func__, up->sg_str,
-				up->dualactive_ifchannel_count, up->flags);
+			zlog_debug("%s: New Dual active if-chnanel is added to upstream:(%s:%u:%u)%s count:%d, flags:0x%x",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   up->dualactive_ifchannel_count, up->flags);
 	}

 	if (up_flags == PIM_UPSTREAM_FLAG_MASK_SRC_PIM)
@@ -658,8 +658,8 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, pim_sgaddr *sg,
 		PIM_IF_FLAG_SET_PROTO_IGMP(ch->flags);

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: ifchannel %s(%s) is created ", __func__,
-			   ch->sg_str, ch->interface->name);
+		zlog_debug("%s: ifchannel (%s:%u:%u)%s(%s) is created ", __func__,
+			   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ch->interface->name);

 	return ch;
 }
@@ -682,8 +682,8 @@ static void on_ifjoin_expiry_timer(struct event *t)
 	ch = EVENT_ARG(t);

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: ifchannel %s expiry timer", __func__,
-			   ch->sg_str);
+		zlog_debug("%s: ifchannel (%s:%u:%u)%s expiry timer", __func__,
+			   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);

 	ifjoin_to_noinfo(ch);
 	/* ch may have been deleted */
@@ -780,8 +780,8 @@ static void check_recv_upstream(int is_join, struct interface *recv_ifp,

 	if (pim_rpf_addr_is_inaddr_any(&up->rpf)) {
 		/* RPF'(S,G) not found */
-		zlog_warn("%s %s: RPF'%s not found", __FILE__, __func__,
-			  up->sg_str);
+		zlog_warn("%s %s: RPF'(%s:%u:%u)%s not found", __FILE__, __func__,
+			  PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -789,10 +789,9 @@ static void check_recv_upstream(int is_join, struct interface *recv_ifp,

 	/* upstream directed to RPF'(S,G) ? */
 	if (pim_addr_cmp(upstream, rpf_addr)) {
-		zlog_warn(
-			"%s %s: (S,G)=%s upstream=%pPAs not directed to RPF'(S,G)=%pPAs on interface %s",
-			__FILE__, __func__, up->sg_str, &upstream, &rpf_addr,
-			recv_ifp->name);
+		zlog_warn("%s %s: (S,G)=(%s:%u:%u)%s upstream=%pPAs not directed to RPF'(S,G)=%pPAs on interface %s",
+			  __FILE__, __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &upstream,
+			  &rpf_addr, recv_ifp->name);
 		return;
 	}
 	/* upstream directed to RPF'(S,G) */
@@ -905,8 +904,8 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr,
 	  address of the join message is our primary address.
 	 */
 	if (ch->ifassert_state == PIM_IFASSERT_I_AM_LOSER) {
-		zlog_warn("%s: Assert Loser recv Join%s from %pPA on %s",
-			  __func__, ch->sg_str, &neigh_addr, ifp->name);
+		zlog_warn("%s: Assert Loser recv Join(%s:%u:%u)%s from %pPA on %s", __func__,
+			  PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, &neigh_addr, ifp->name);

 		assert_action_a5(ch);
 	}
@@ -1232,17 +1231,18 @@ int pim_ifchannel_local_membership_add(struct interface *ifp, pim_sgaddr *sg,

 		for (ALL_LIST_ELEMENTS_RO(up->sources, up_node, child)) {
 			if (PIM_DEBUG_EVENTS)
-				zlog_debug("%s %s: IGMP (S,G)=%s(%s) from %s",
-					   __FILE__, __func__, child->sg_str,
-					   ifp->name, up->sg_str);
+				zlog_debug("%s %s: IGMP (S,G)=(%s:%u:%u)%s(%s) from (%s:%u:%u)%s",
+					   __FILE__, __func__, PIM_DEBUG_VRF(child->pim->vrf),
+					   child->sg_str, ifp->name, PIM_DEBUG_VRF(up->pim->vrf),
+					   up->sg_str);

 			if (!child->rpf.source_nexthop.interface) {
 				/* when iif unknown, do not inherit */
 				if (PIM_DEBUG_EVENTS)
-					zlog_debug(
-						"Skipped (S,G)=%s(%s) from %s: no iif",
-						child->sg_str, ifp->name,
-						up->sg_str);
+					zlog_debug("Skipped (S,G)=(%s:%u:%u)%s(%s) from (%s:%u:%u)%s: no iif",
+						   PIM_DEBUG_VRF(child->pim->vrf), child->sg_str,
+						   ifp->name, PIM_DEBUG_VRF(up->pim->vrf),
+						   up->sg_str);
 				continue;
 			}

@@ -1314,9 +1314,10 @@ void pim_ifchannel_local_membership_del(struct interface *ifp, pim_sgaddr *sg)
 			pim_ifp = ifp->info;

 			if (PIM_DEBUG_EVENTS)
-				zlog_debug("%s %s: Prune(S,G)=%s(%s) from %s",
-					   __FILE__, __func__, up->sg_str,
-					   ifp->name, child->sg_str);
+				zlog_debug("%s %s: Prune(S,G)=(%s:%u:%u)%s(%s) from (%s:%u:%u)%s",
+					   __FILE__, __func__, PIM_DEBUG_VRF(up->pim->vrf),
+					   up->sg_str, ifp->name, PIM_DEBUG_VRF(child->pim->vrf),
+					   child->sg_str);

 			/*
 			 * If the S,G has no if channel and the c_oil still
@@ -1493,9 +1494,9 @@ void pim_ifchannel_set_star_g_join_state(struct pim_ifchannel *ch, int eom,
 	struct pim_upstream *starup = ch->upstream;

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: %s %s eom: %d join %u", __func__,
-			   pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->sg_rpt), ch->sg_str,
-			   eom, join);
+		zlog_debug("%s: %s (%s:%u:%u)%s eom: %d join %u", __func__,
+			   pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->sg_rpt),
+			   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, eom, join);
 	if (!ch->sources)
 		return;

diff --git a/pimd/pim_igmp_mtrace.c b/pimd/pim_igmp_mtrace.c
index 53ca256a84..f6c27badbb 100644
--- a/pimd/pim_igmp_mtrace.c
+++ b/pimd/pim_igmp_mtrace.c
@@ -115,8 +115,8 @@ static bool mtrace_fwd_info(struct pim_instance *pim,

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return false;
 	}

diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 4552344a38..9b428a1d34 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -379,9 +379,9 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
 				struct pim_upstream *up = sg_ch->upstream;
 				if (up) {
 					if (PIM_DEBUG_PIM_TRACE)
-						zlog_debug(
-							"%s: SGRpt flag is set, del inherit oif from up %s",
-							__func__, up->sg_str);
+						zlog_debug("%s: SGRpt flag is set, del inherit oif from up (%s:%u:%u)%s",
+							   __func__, PIM_DEBUG_VRF(up->pim->vrf),
+							   up->sg_str);
 					pim_channel_del_inherited_oif(
 						up->channel_oil,
 						starg_ch->interface,
@@ -572,8 +572,8 @@ static void pim_jp_groups_source_set_prune(struct list *sources)

 	upstream = js->up;
 	if (PIM_DEBUG_PIM_PACKETS)
-		zlog_debug("%s: Considering (%s) children for (S,G,rpt) prune", __func__,
-			   upstream->sg_str);
+		zlog_debug("%s: Considering ((%s:%u:%u)%s) children for (S,G,rpt) prune", __func__,
+			   PIM_DEBUG_VRF(upstream->pim->vrf), upstream->sg_str);

 	for (ALL_LIST_ELEMENTS_RO(upstream->sources, node, child)) {
 		/*
@@ -599,8 +599,8 @@ static void pim_jp_groups_source_set_prune(struct list *sources)
 		if (PIM_UPSTREAM_FLAG_TEST_SRC_VXLAN_ORIG(child->flags) &&
 		    listcount(child->ifchannels) == 0) {
 			if (PIM_DEBUG_PIM_PACKETS)
-				zlog_debug("%s: %s Vxlan originated S,G route with no ifchannels, not adding prune to compound message",
-					   __func__, child->sg_str);
+				zlog_debug("%s: (%s:%u:%u)%s Vxlan originated S,G route with no ifchannels, not adding prune to compound message",
+					   __func__, PIM_DEBUG_VRF(child->pim->vrf), child->sg_str);
 		} else if (!PIM_UPSTREAM_FLAG_TEST_USE_RPT(child->flags)) {
 			/* If we are using SPT and the SPT and RPT IIFs
 			 * are different we can prune the source off
@@ -613,11 +613,15 @@ static void pim_jp_groups_source_set_prune(struct list *sources)
 			    !pim_rpf_is_same(&upstream->rpf, &child->rpf)) {
 				PIM_UPSTREAM_FLAG_SET_SEND_SG_RPT_PRUNE(child->flags);
 				if (PIM_DEBUG_PIM_PACKETS)
-					zlog_debug("%s: SPT Bit and RPF'(%s) != RPF'(S,G): Add Prune (%s,rpt) to compound message",
-						   __func__, upstream->sg_str, child->sg_str);
+					zlog_debug("%s: SPT Bit and RPF'((%s:%u:%u)%s) != RPF'(S,G): Add Prune ((%s:%u:%u)%s,rpt) to compound message",
+						   __func__, PIM_DEBUG_VRF(upstream->pim->vrf),
+						   upstream->sg_str,
+						   PIM_DEBUG_VRF(child->pim->vrf), child->sg_str);
 			} else if (PIM_DEBUG_PIM_PACKETS)
-				zlog_debug("%s: SPT Bit and RPF'(%s) == RPF'(S,G): Not adding Prune for (%s,rpt)",
-					   __func__, upstream->sg_str, child->sg_str);
+				zlog_debug("%s: SPT Bit and RPF'((%s:%u:%u)%s) == RPF'(S,G): Not adding Prune for ((%s:%u:%u)%s,rpt)",
+					   __func__, PIM_DEBUG_VRF(upstream->pim->vrf),
+					   upstream->sg_str, PIM_DEBUG_VRF(child->pim->vrf),
+					   child->sg_str);
 		} else if (pim_upstream_empty_inherited_olist(child)) {
 			/* S is supposed to be forwarded along the RPT
 			 * but it's inherited OIL is empty. So just
@@ -625,11 +629,12 @@ static void pim_jp_groups_source_set_prune(struct list *sources)
 			 */
 			PIM_UPSTREAM_FLAG_SET_SEND_SG_RPT_PRUNE(child->flags);
 			if (PIM_DEBUG_PIM_PACKETS)
-				zlog_debug("%s: inherited_olist(%s,rpt) is NULL, Add Prune to compound message",
-					   __func__, child->sg_str);
+				zlog_debug("%s: inherited_olist((%s:%u:%u)%s,rpt) is NULL, Add Prune to compound message",
+					   __func__, PIM_DEBUG_VRF(child->pim->vrf), child->sg_str);
 		} else if (PIM_DEBUG_PIM_PACKETS)
-			zlog_debug("%s: Do not add Prune %s to compound message %s", __func__,
-				   child->sg_str, upstream->sg_str);
+			zlog_debug("%s: Do not add Prune (%s:%u:%u)%s to compound message (%s:%u:%u)%s",
+				   __func__, PIM_DEBUG_VRF(child->pim->vrf), child->sg_str,
+				   PIM_DEBUG_VRF(upstream->pim->vrf), upstream->sg_str);
 	}
 }

diff --git a/pimd/pim_jp_agg.c b/pimd/pim_jp_agg.c
index d8048149be..7e0ce7ed17 100644
--- a/pimd/pim_jp_agg.c
+++ b/pimd/pim_jp_agg.c
@@ -146,8 +146,8 @@ void pim_jp_agg_remove_group(struct list *group, struct pim_upstream *up,

 	if (nbr) {
 		if (PIM_DEBUG_TRACE)
-			zlog_debug("up %s remove from nbr %s/%pPAs jp-agg-list",
-				   up->sg_str, nbr->interface->name,
+			zlog_debug("up (%s:%u:%u)%s remove from nbr %s/%pPAs jp-agg-list",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, nbr->interface->name,
 				   &nbr->source_addr);
 	}

@@ -225,8 +225,8 @@ void pim_jp_agg_upstream_verification(struct pim_upstream *up, bool ignore)

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -283,10 +283,9 @@ void pim_jp_agg_add_group(struct list *group, struct pim_upstream *up,

 	if (nbr) {
 		if (PIM_DEBUG_TRACE)
-			zlog_debug("up %s add to nbr %s/%pPAs jp-agg-list",
-				   up->sg_str,
-				   up->rpf.source_nexthop.interface->name,
-				   &nbr->source_addr);
+			zlog_debug("up (%s:%u:%u)%s add to nbr %s/%pPAs jp-agg-list",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   up->rpf.source_nexthop.interface->name, &nbr->source_addr);
 	}

 	if (!js) {
diff --git a/pimd/pim_macro.c b/pimd/pim_macro.c
index 891a3d427e..651505c38c 100644
--- a/pimd/pim_macro.c
+++ b/pimd/pim_macro.c
@@ -102,7 +102,8 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)

 	ifp = ch->interface;
 	if (!ifp) {
-		zlog_warn("%s: (S,G)=%s: null interface", __func__, ch->sg_str);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s: null interface", __func__,
+			  "UNKNOWN", VRF_UNKNOWN, 0, ch->sg_str);
 		return 0; /* false */
 	}

@@ -112,8 +113,8 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)

 	pim_ifp = ifp->info;
 	if (!pim_ifp) {
-		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
-			  __func__, ch->sg_str, ifp->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s: multicast not enabled on interface %s",
+			  __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ifp->name);
 		return 0; /* false */
 	}

@@ -149,8 +150,8 @@ int pim_macro_chisin_pim_include(const struct pim_ifchannel *ch)
 	bool mlag_active = false;

 	if (!pim_ifp) {
-		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
-			  __func__, ch->sg_str, ch->interface->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s: multicast not enabled on interface %s", __func__,
+			  PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ch->interface->name);
 		return 0; /* false */
 	}

@@ -223,7 +224,8 @@ int pim_macro_ch_could_assert_eval(const struct pim_ifchannel *ch)

 	ifp = ch->interface;
 	if (!ifp) {
-		zlog_warn("%s: (S,G)=%s: null interface", __func__, ch->sg_str);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s: null interface", __func__,
+			  "UNKNOWN", VRF_UNKNOWN, 0, ch->sg_str);
 		return 0; /* false */
 	}

@@ -390,14 +392,15 @@ int pim_macro_assert_tracking_desired_eval(const struct pim_ifchannel *ch)

 	ifp = ch->interface;
 	if (!ifp) {
-		zlog_warn("%s: (S,G)=%s: null interface", __func__, ch->sg_str);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s: null interface", __func__,
+			  "UNKOWN", VRF_UNKNOWN, 0, ch->sg_str);
 		return 0; /* false */
 	}

 	pim_ifp = ifp->info;
 	if (!pim_ifp) {
-		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s",
-			  __func__, ch->sg_str, ch->interface->name);
+		zlog_warn("%s: (S,G)=(%s:%u:%u)%s: multicast not enabled on interface %s", __func__,
+			  PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ch->interface->name);
 		return 0; /* false */
 	}

diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c
index a1e136494c..979fed86a8 100644
--- a/pimd/pim_mlag.c
+++ b/pimd/pim_mlag.c
@@ -21,24 +21,24 @@ extern struct zclient *pim_zclient;

 /*********************ACtual Data processing *****************************/
 /* TBD: There can be duplicate updates to FIB***/
-#define PIM_MLAG_ADD_OIF_TO_OIL(ch, ch_oil)                                    \
-	do {                                                                   \
-		if (PIM_DEBUG_MLAG)                                            \
-			zlog_debug(                                            \
-				"%s: add Dual-active Interface to %s "         \
-				"to oil:%s",                                   \
-				__func__, ch->interface->name, ch->sg_str);    \
-		pim_channel_update_oif_mute(ch_oil, ch->interface->info);      \
+#define PIM_MLAG_ADD_OIF_TO_OIL(ch, ch_oil)                                                       \
+	do {                                                                                      \
+		if (PIM_DEBUG_MLAG)                                                               \
+			zlog_debug("%s: add Dual-active Interface to %s "                         \
+				   "to oil:(%s:%u:%u)%s",                                         \
+				   __func__, ch->interface->name,                                 \
+				   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);                \
+		pim_channel_update_oif_mute(ch_oil, ch->interface->info);                         \
 	} while (0)

-#define PIM_MLAG_DEL_OIF_TO_OIL(ch, ch_oil)                                    \
-	do {                                                                   \
-		if (PIM_DEBUG_MLAG)                                            \
-			zlog_debug(                                            \
-				"%s: del Dual-active Interface to %s "         \
-				"to oil:%s",                                   \
-				__func__, ch->interface->name, ch->sg_str);    \
-		pim_channel_update_oif_mute(ch_oil, ch->interface->info);      \
+#define PIM_MLAG_DEL_OIF_TO_OIL(ch, ch_oil)                                                       \
+	do {                                                                                      \
+		if (PIM_DEBUG_MLAG)                                                               \
+			zlog_debug("%s: del Dual-active Interface to %s "                         \
+				   "to oil:(%s:%u:%u)%s",                                         \
+				   __func__, ch->interface->name,                                 \
+				   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str);                \
+		pim_channel_update_oif_mute(ch_oil, ch->interface->info);                         \
 	} while (0)


@@ -57,8 +57,8 @@ static void pim_mlag_calculate_df_for_ifchannels(struct pim_upstream *up,
 		return;

 	if (PIM_DEBUG_MLAG)
-		zlog_debug("%s: Calculating DF for Dual active if-channel%s",
-			   __func__, up->sg_str);
+		zlog_debug("%s: Calculating DF for Dual active if-channel(%s:%u:%u)%s", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 	for (ALL_LIST_ELEMENTS(up->ifchannels, chnode, chnextnode, ch)) {
 		pim_ifp = (ch->interface) ? ch->interface->info : NULL;
@@ -83,8 +83,8 @@ static void pim_mlag_inherit_mlag_flags(struct pim_upstream *up, bool is_df)
 	struct channel_oil *ch_oil = NULL;

 	if (PIM_DEBUG_MLAG)
-		zlog_debug("%s: Updating DF for uptream:%s children", __func__,
-			   up->sg_str);
+		zlog_debug("%s: Updating DF for uptream:(%s:%u:%u)%s children", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);


 	for (ALL_LIST_ELEMENTS(up->ifchannels, chnode, chnextnode, ch)) {
@@ -94,8 +94,8 @@ static void pim_mlag_inherit_mlag_flags(struct pim_upstream *up, bool is_df)

 		for (ALL_LIST_ELEMENTS_RO(up->sources, listnode, child)) {
 			if (PIM_DEBUG_MLAG)
-				zlog_debug("%s: Updating DF for child:%s",
-					   __func__, child->sg_str);
+				zlog_debug("%s: Updating DF for child:(%s:%u:%u)%s", __func__,
+					   PIM_DEBUG_VRF(child->pim->vrf), child->sg_str);
 			ch_oil = (child) ? child->channel_oil : NULL;

 			if (!ch_oil)
@@ -120,15 +120,15 @@ bool pim_mlag_up_df_role_update(struct pim_instance *pim,

 	if (is_df == old_is_df) {
 		if (PIM_DEBUG_MLAG)
-			zlog_debug(
-				"%s: Ignoring Role update for %s, since no change",
-				__func__, up->sg_str);
+			zlog_debug("%s: Ignoring Role update for (%s:%u:%u)%s, since no change",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return false;
 	}

 	if (PIM_DEBUG_MLAG)
-		zlog_debug("local MLAG mroute %s role changed to %s based on %s",
-				up->sg_str, is_df ? "df" : "non-df", reason);
+		zlog_debug("local MLAG mroute (%s:%u:%u)%s role changed to %s based on %s",
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, is_df ? "df" : "non-df",
+			   reason);

 	if (is_df)
 		PIM_UPSTREAM_FLAG_UNSET_MLAG_NON_DF(up->flags);
@@ -416,8 +416,8 @@ static void pim_mlag_up_local_add_send(struct pim_instance *pim,
 		return;

 	if (PIM_DEBUG_MLAG)
-		zlog_debug("local MLAG mroute add %s:%s",
-				vrf->name, up->sg_str);
+		zlog_debug("local MLAG mroute add %s:(%s:%u:%u)%s", vrf->name,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 	++router->mlag_stats.msg.mroute_add_tx;

@@ -454,8 +454,8 @@ static void pim_mlag_up_local_del_send(struct pim_instance *pim,
 		return;

 	if (PIM_DEBUG_MLAG)
-		zlog_debug("local MLAG mroute del %s:%s",
-				vrf->name, up->sg_str);
+		zlog_debug("local MLAG mroute del %s:(%s:%u:%u)%s", vrf->name,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 	++router->mlag_stats.msg.mroute_del_tx;

diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index f68ece132d..cfbef53c7e 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -539,7 +539,8 @@ int pim_mroute_msg_nocache(int fd, struct interface *ifp, const kernmsg *msg)
 	 * I want to take advantage of the up->sg_str being filled in.
 	 */
 	if (PIM_DEBUG_MROUTE)
-		zlog_debug("%s: Adding a Route %s for WHOLEPKT consumption", __func__, up->sg_str);
+		zlog_debug("%s: Adding a Route (%s:%u:%u)%s for WHOLEPKT consumption", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 	if (!pim_is_group_filtered(pim_ifp, &sg.grp, &sg.src))
 		pim_register_join(up);
@@ -641,7 +642,8 @@ int pim_mroute_msg_wholepkt(int fd, struct interface *ifp, const char *buf,
 				pim_upstream_update_join_desired(pim_ifp->pim, up);

 				if (PIM_DEBUG_MROUTE)
-					zlog_debug("%s: Creating %s upstream on LHR", __func__,
+					zlog_debug("%s: Creating (%s:%u:%u)%s upstream on LHR",
+						   __func__, PIM_DEBUG_VRF(up->pim->vrf),
 						   up->sg_str);
 				return 0;
 			}
@@ -657,8 +659,8 @@ have_up:

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return 0;
 	}

@@ -686,9 +688,8 @@ have_up:

 		if (!PIM_UPSTREAM_FLAG_TEST_FHR(up->flags)) {
 			if (PIM_DEBUG_PIM_REG)
-				zlog_debug(
-					"%s register forward skipped, not FHR",
-					up->sg_str);
+				zlog_debug("(%s:%u:%u)%s register forward skipped, not FHR",
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			return 0;
 		}

@@ -1100,27 +1101,27 @@ int pim_mroute_msg_wrongvif(int fd, struct interface *ifp, const kernmsg *msg)

 	if (ch->ifassert_state != PIM_IFASSERT_NOINFO) {
 		if (PIM_DEBUG_MROUTE) {
-			zlog_debug(
-				"%s: WRONGVIF (S,G)=%s channel is not on Assert NoInfo state for interface %s",
-				__func__, ch->sg_str, ifp->name);
+			zlog_debug("%s: WRONGVIF (S,G)=(%s:%u:%u)%s channel is not on Assert NoInfo state for interface %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ifp->name);
 		}
 		return -4;
 	}

 	if (!PIM_IF_FLAG_TEST_COULD_ASSERT(ch->flags)) {
 		if (PIM_DEBUG_MROUTE) {
-			zlog_debug(
-				"%s: WRONGVIF (S,G)=%s interface %s is not downstream for channel",
-				__func__, ch->sg_str, ifp->name);
+			zlog_debug("%s: WRONGVIF (S,G)=(%s:%u:%u)%s interface %s is not downstream for channel",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ifp->name);
 		}
 		return -5;
 	}

 	if (assert_action_a1(ch)) {
 		if (PIM_DEBUG_MROUTE) {
-			zlog_debug(
-				"%s: WRONGVIF (S,G)=%s assert_action_a1 failure on interface %s",
-				__func__, ch->sg_str, ifp->name);
+			zlog_debug("%s: WRONGVIF (S,G)=(%s:%u:%u)%s assert_action_a1 failure on interface %s",
+				   __func__, PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str,
+				   ifp->name);
 		}
 		return -6;
 	}
@@ -1173,9 +1174,8 @@ int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp, const char *buf,
 	pim_ifchannel_find(ifp, &sg, &ch, &throwaway);
 	if (ch) {
 		if (PIM_DEBUG_MROUTE)
-			zlog_debug(
-				"WRVIFWHOLE (S,G)=%s found ifchannel on interface %s",
-				ch->sg_str, ifp->name);
+			zlog_debug("WRVIFWHOLE (S,G)=(%s:%u:%u)%s found ifchannel on interface %s",
+				   PIM_DEBUG_VRF(ch->interface->vrf), ch->sg_str, ifp->name);
 		return -1;
 	}

diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c
index 1130af56cd..6a0ec72434 100644
--- a/pimd/pim_msdp.c
+++ b/pimd/pim_msdp.c
@@ -106,7 +106,8 @@ static void pim_msdp_sa_state_timer_cb(struct event *t)
 	sa = EVENT_ARG(t);

 	if (pim_msdp_log_sa_events(sa->pim))
-		zlog_info("MSDP SA %s state timer expired", sa->sg_str);
+		zlog_info("MSDP SA (%s:%u:%u)%s state timer expired", PIM_DEBUG_VRF(sa->pim->vrf),
+			  sa->sg_str);

 	pim_msdp_sa_deref(sa, PIM_MSDP_SAF_PEER);
 }
@@ -142,7 +143,8 @@ static void pim_msdp_sa_upstream_del(struct pim_msdp_sa *sa)
 	}

 	if (pim_msdp_log_sa_events(sa->pim))
-		zlog_info("MSDP SA %s de-referenced SPT", sa->sg_str);
+		zlog_info("MSDP SA (%s:%u:%u)%s de-referenced SPT", PIM_DEBUG_VRF(sa->pim->vrf),
+			  sa->sg_str);
 }

 static bool pim_msdp_sa_upstream_add_ok(struct pim_msdp_sa *sa,
@@ -206,7 +208,8 @@ static void pim_msdp_sa_upstream_update(struct pim_msdp_sa *sa,
 		/* somehow we lost track of the upstream ptr? best log it */
 		sa->up = up;
 		if (pim_msdp_log_sa_events(sa->pim))
-			zlog_info("MSDP SA %s SPT reference missing", sa->sg_str);
+			zlog_info("MSDP SA (%s:%u:%u)%s SPT reference missing",
+				  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 		return;
 	}

@@ -223,10 +226,12 @@ static void pim_msdp_sa_upstream_update(struct pim_msdp_sa *sa,
 		 * when the
 		 * SA ages out */
 		if (pim_msdp_log_sa_events(sa->pim))
-			zlog_info("MSDP SA %s referenced SPT", sa->sg_str);
+			zlog_info("MSDP SA (%s:%u:%u)%s referenced SPT",
+				  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 	} else {
 		if (pim_msdp_log_sa_events(sa->pim))
-			zlog_info("MSDP SA %s SPT reference failed", sa->sg_str);
+			zlog_info("MSDP SA (%s:%u:%u)%s SPT reference failed",
+				  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 	}
 }

@@ -256,7 +261,7 @@ static struct pim_msdp_sa *pim_msdp_sa_new(struct pim_instance *pim,
 	listnode_add_sort(pim->msdp.sa_list, sa);

 	if (pim_msdp_log_sa_events(pim))
-		zlog_info("MSDP SA %s created", sa->sg_str);
+		zlog_info("MSDP SA (%s:%u:%u)%s created", PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 	return sa;
 }
@@ -297,7 +302,7 @@ static void pim_msdp_sa_del(struct pim_msdp_sa *sa)
 	hash_release(sa->pim->msdp.sa_hash, sa);

 	if (pim_msdp_log_sa_events(sa->pim))
-		zlog_info("MSDP SA %s deleted", sa->sg_str);
+		zlog_info("MSDP SA (%s:%u:%u)%s deleted", PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 	/* free up any associated memory */
 	pim_msdp_sa_free(sa);
@@ -347,7 +352,8 @@ static void pim_msdp_sa_deref(struct pim_msdp_sa *sa,
 	if ((sa->flags & PIM_MSDP_SAF_LOCAL)) {
 		if (flags & PIM_MSDP_SAF_LOCAL) {
 			if (pim_msdp_log_sa_events(sa->pim))
-				zlog_info("MSDP SA %s local reference removed", sa->sg_str);
+				zlog_info("MSDP SA (%s:%u:%u)%s local reference removed",
+					  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 			if (sa->pim->msdp.local_cnt)
 				--sa->pim->msdp.local_cnt;
@@ -359,7 +365,8 @@ static void pim_msdp_sa_deref(struct pim_msdp_sa *sa,
 			struct in_addr rp;

 			if (pim_msdp_log_sa_events(sa->pim))
-				zlog_info("MSDP SA %s peer reference removed", sa->sg_str);
+				zlog_info("MSDP SA (%s:%u:%u)%s peer reference removed",
+					  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 			pim_msdp_sa_state_timer_setup(sa, false /* start */);
 			rp.s_addr = INADDR_ANY;
@@ -406,7 +413,8 @@ void pim_msdp_sa_ref(struct pim_instance *pim, struct pim_msdp_peer *mp,
 		if (!(sa->flags & PIM_MSDP_SAF_PEER)) {
 			sa->flags |= PIM_MSDP_SAF_PEER;
 			if (pim_msdp_log_sa_events(pim))
-				zlog_info("MSDP SA %s added by peer", sa->sg_str);
+				zlog_info("MSDP SA (%s:%u:%u)%s added by peer",
+					  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 		}
 		pim_msdp_sa_peer_ip_set(sa, mp, rp);
 		/* start/re-start the state timer to prevent cache expiry */
@@ -421,7 +429,8 @@ void pim_msdp_sa_ref(struct pim_instance *pim, struct pim_msdp_peer *mp,
 			sa->flags |= PIM_MSDP_SAF_LOCAL;
 			++sa->pim->msdp.local_cnt;
 			if (pim_msdp_log_sa_events(pim))
-				zlog_info("MSDP SA %s added locally", sa->sg_str);
+				zlog_info("MSDP SA (%s:%u:%u)%s added locally",
+					  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 			/* send an immediate SA update to peers */
 			pim_addr_to_prefix(&grp, sa->sg.grp);
@@ -499,15 +508,15 @@ static void pim_msdp_sa_local_del_on_up_del(struct pim_instance *pim,
 	sa = pim_msdp_sa_find(pim, sg);
 	if (sa) {
 		if (PIM_DEBUG_MSDP_INTERNAL) {
-			zlog_debug("MSDP local sa %s del on up del",
-				   sa->sg_str);
+			zlog_debug("MSDP local sa (%s:%u:%u)%s del on up del",
+				   PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 		}

 		/* if there is no local reference escape */
 		if (!(sa->flags & PIM_MSDP_SAF_LOCAL)) {
 			if (PIM_DEBUG_MSDP_INTERNAL) {
-				zlog_debug("MSDP local sa %s del; no local ref",
-					   sa->sg_str);
+				zlog_debug("MSDP local sa (%s:%u:%u)%s del; no local ref",
+					   PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 			}
 			return;
 		}
@@ -524,10 +533,9 @@ static void pim_msdp_sa_local_del_on_up_del(struct pim_instance *pim,
 			 * the flow. Accounting for such cases requires lot of
 			 * changes; perhaps
 			 * address this in the next release? - XXX  */
-			flog_err(
-				EC_LIB_DEVELOPMENT,
-				"MSDP sa %s SPT teardown is causing the local entry to be removed",
-				sa->sg_str);
+			flog_err(EC_LIB_DEVELOPMENT,
+				 "MSDP sa (%s:%u:%u)%s SPT teardown is causing the local entry to be removed",
+				 PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 			return;
 		}

@@ -535,8 +543,8 @@ static void pim_msdp_sa_local_del_on_up_del(struct pim_instance *pim,
 		 * upstream reference */
 		if (sa->up) {
 			if (PIM_DEBUG_MSDP_INTERNAL) {
-				zlog_debug("MSDP local sa %s del; up non-NULL",
-					   sa->sg_str);
+				zlog_debug("MSDP local sa (%s:%u:%u)%s del; up non-NULL",
+					   PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);
 			}
 			sa->up = NULL;
 		}
@@ -628,7 +636,8 @@ void pim_msdp_up_join_state_changed(struct pim_instance *pim,
 	struct pim_msdp_sa *sa;

 	if (PIM_DEBUG_MSDP_INTERNAL) {
-		zlog_debug("MSDP join state changed for %s", xg_up->sg_str);
+		zlog_debug("MSDP join state changed for (%s:%u:%u)%s",
+			   PIM_DEBUG_VRF(xg_up->pim->vrf), xg_up->sg_str);
 	}

 	/* If this is not really an XG entry just move on */
diff --git a/pimd/pim_msdp_packet.c b/pimd/pim_msdp_packet.c
index 5f00f12e3c..43dd03b62c 100644
--- a/pimd/pim_msdp_packet.c
+++ b/pimd/pim_msdp_packet.c
@@ -430,7 +430,8 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim,

 		if (msdp_peer_sa_filter(mp, sa)) {
 			if (pim_msdp_log_sa_events(pim))
-				zlog_info("MSDP peer %pI4 filter SA out %s", &mp->peer, sa->sg_str);
+				zlog_info("MSDP peer %pI4 filter SA out (%s:%u:%u)%s", &mp->peer,
+					  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 			mp->acl_out_count++;
 			continue;
@@ -493,7 +494,8 @@ void pim_msdp_pkt_sa_tx_one(struct pim_msdp_sa *sa)
 	for (ALL_LIST_ELEMENTS_RO(sa->pim->msdp.peer_list, node, mp)) {
 		if (msdp_peer_sa_filter(mp, sa)) {
 			if (pim_msdp_log_sa_events(sa->pim))
-				zlog_info("MSDP peer %pI4 filter SA out %s", &mp->peer, sa->sg_str);
+				zlog_info("MSDP peer %pI4 filter SA out (%s:%u:%u)%s", &mp->peer,
+					  PIM_DEBUG_VRF(sa->pim->vrf), sa->sg_str);

 			mp->acl_out_count++;
 			continue;
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c
index c777dd7c01..c44352d337 100644
--- a/pimd/pim_nht.c
+++ b/pimd/pim_nht.c
@@ -692,8 +692,9 @@ void pim_nht_delete_tracked_upstream(struct pim_instance *pim, pim_addr addr,
 	pnc = hash_lookup(pim->nht_hash, &lookup);
 	if (!pnc) {
 		if (PIM_DEBUG_PIM_NHT)
-			zlog_debug("%s: NHT %pPA(%s) not found for upstream %s; nothing to release",
-				   __func__, &addr, pim->vrf->name, up->sg_str);
+			zlog_debug("%s: NHT %pPA(%s) not found for upstream (%s:%u:%u)%s; nothing to release",
+				   __func__, &addr, pim->vrf->name, PIM_DEBUG_VRF(up->pim->vrf),
+				   up->sg_str);
 		return;
 	}

@@ -702,13 +703,14 @@ void pim_nht_delete_tracked_upstream(struct pim_instance *pim, pim_addr addr,
 	 */
 	if (hash_release(pnc->upstream_hash, up)) {
 		if (PIM_DEBUG_PIM_NHT)
-			zlog_debug("%s: released upstream %s from NHT %pPA(%s); remaining upstream count:%ld",
-				   __func__, up->sg_str, &addr, pim->vrf->name,
-				   pnc->upstream_hash->count);
+			zlog_debug("%s: released upstream (%s:%u:%u)%s from NHT %pPA(%s); remaining upstream count:%ld",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &addr,
+				   pim->vrf->name, pnc->upstream_hash->count);
 		pim_nht_drop_maybe(pim, pnc);
 	} else if (PIM_DEBUG_PIM_NHT) {
-		zlog_debug("%s: upstream %s not in NHT %pPA(%s) bucket; redundant cleanup",
-			   __func__, up->sg_str, &addr, pim->vrf->name);
+		zlog_debug("%s: upstream (%s:%u:%u)%s not in NHT %pPA(%s) bucket; redundant cleanup",
+			   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &addr,
+			   pim->vrf->name);
 	}
 }

@@ -1026,13 +1028,11 @@ static int pim_update_upstream_nh_helper(struct hash_bucket *bucket, void *arg)
 	}

 	if (PIM_DEBUG_PIM_NHT) {
-		zlog_debug("%s: NHT upstream %s(%s) old ifp %s new ifp %s rpf_result: %d",
-			   __func__, up->sg_str, pim->vrf->name,
-			   old.source_nexthop.interface ? old.source_nexthop
-								  .interface->name
+		zlog_debug("%s: NHT upstream (%s:%u:%u)%s(%s) old ifp %s new ifp %s rpf_result: %d",
+			   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name,
+			   old.source_nexthop.interface ? old.source_nexthop.interface->name
 							: "Unknown",
-			   up->rpf.source_nexthop.interface ? up->rpf.source_nexthop
-								      .interface->name
+			   up->rpf.source_nexthop.interface ? up->rpf.source_nexthop.interface->name
 							    : "Unknown",
 			   rpf_result);
 	}
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index 5ef32b6657..ae964f3889 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -41,8 +41,8 @@ void pim_register_join(struct pim_upstream *up)

 	if (pim_is_grp_ssm(pim, up->sg.grp)) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_debug("%s register setup skipped as group is SSM",
-				   up->sg_str);
+			zlog_debug("(%s:%u:%u)%s register setup skipped as group is SSM",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -224,15 +224,15 @@ int pim_register_stop_recv(struct interface *ifp, pim_addr src_addr, uint8_t *bu
 		 */
 		for (ALL_LIST_ELEMENTS_RO(up->sources, up_node, child)) {
 			if (PIM_DEBUG_PIM_REG)
-				zlog_debug(
-					"Executing Reg stop for upstream child %s",
-					child->sg_str);
+				zlog_debug("Executing Reg stop for upstream child (%s:%u:%u)%s",
+					   PIM_DEBUG_VRF(child->pim->vrf), child->sg_str);

 			pim_reg_stop_upstream(pim, child);
 		}

 		if (PIM_DEBUG_PIM_REG)
-			zlog_debug("Executing Reg stop for %s", up->sg_str);
+			zlog_debug("Executing Reg stop for (%s:%u:%u)%s",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		pim_reg_stop_upstream(pim, up);
 	} else {
 		if (!handling_star)
@@ -247,9 +247,8 @@ int pim_register_stop_recv(struct interface *ifp, pim_addr src_addr, uint8_t *bu
 		frr_each (rb_pim_upstream, &pim->upstream_head, up) {
 			if (pim_addr_cmp(up->sg.grp, sg.grp) == 0) {
 				if (PIM_DEBUG_PIM_REG)
-					zlog_debug(
-						"Executing Reg stop for upstream %s",
-						up->sg_str);
+					zlog_debug("Executing Reg stop for upstream (%s:%u:%u)%s",
+						   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 				pim_reg_stop_upstream(pim, up);
 			}
 		}
@@ -310,8 +309,9 @@ void pim_register_send(const uint8_t *buf, int buf_size, pim_addr src,
 	struct interface *ifp;

 	if (PIM_DEBUG_PIM_REG) {
-		zlog_debug("Sending %s %sRegister Packet to %pPA", up->sg_str,
-			   null_register ? "NULL " : "", &rpg->rpf_addr);
+		zlog_debug("Sending (%s:%u:%u)%s %sRegister Packet to %pPA",
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, null_register ? "NULL " : "",
+			   &rpg->rpf_addr);
 	}

 	ifp = rpg->source_nexthop.interface;
@@ -331,8 +331,8 @@ void pim_register_send(const uint8_t *buf, int buf_size, pim_addr src,
 	}

 	if (PIM_DEBUG_PIM_REG) {
-		zlog_debug("%s: Sending %s %sRegister Packet to %pPA on %s",
-			   __func__, up->sg_str, null_register ? "NULL " : "",
+		zlog_debug("%s: Sending (%s:%u:%u)%s %sRegister Packet to %pPA on %s", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, null_register ? "NULL " : "",
 			   &rpg->rpf_addr, ifp->name);
 	}

@@ -379,18 +379,16 @@ void pim_null_register_send(struct pim_upstream *up)
 	pim_ifp = up->rpf.source_nexthop.interface->info;
 	if (!pim_ifp) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: Cannot send null-register for %s no valid iif",
-				__func__, up->sg_str);
+			zlog_debug("%s: Cannot send null-register for (%s:%u:%u)%s no valid iif",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

 	rpg = RP(pim_ifp->pim, up->sg.grp);
 	if (!rpg) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: Cannot send null-register for %s no RPF to the RP",
-				__func__, up->sg_str);
+			zlog_debug("%s: Cannot send null-register for (%s:%u:%u)%s no RPF to the RP",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -407,9 +405,8 @@ void pim_null_register_send(struct pim_upstream *up)
 	if (PIM_UPSTREAM_FLAG_TEST_SRC_VXLAN_ORIG(up->flags)) {
 		if (!pim_vxlan_get_register_src(pim_ifp->pim, up, &src)) {
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug(
-					"%s: Cannot send null-register for %s vxlan-aa PIP unavailable",
-					__func__, up->sg_str);
+				zlog_debug("%s: Cannot send null-register for (%s:%u:%u)%s vxlan-aa PIP unavailable",
+					   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			return;
 		}
 	}
@@ -430,18 +427,16 @@ void pim_null_register_send(struct pim_upstream *up)
 	pim_ifp = up->rpf.source_nexthop.interface->info;
 	if (!pim_ifp) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"Cannot send null-register for %s no valid iif",
-				up->sg_str);
+			zlog_debug("Cannot send null-register for (%s:%u:%u)%s no valid iif",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

 	rpg = RP(pim_ifp->pim, up->sg.grp);
 	if (!rpg) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"Cannot send null-register for %s no RPF to the RP",
-				up->sg_str);
+			zlog_debug("Cannot send null-register for (%s:%u:%u)%s no RPF to the RP",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -741,13 +736,14 @@ int pim_register_recv(struct interface *ifp, pim_addr dest_addr,
 		    ((SwitchToSptDesiredOnRp(pim, &sg)) &&
 		     pim_upstream_inherited_olist(pim, upstream) == 0)) {
 			if (PIM_DEBUG_PIM_REG)
-				zlog_debug("sending pim register stop message :  %s ",
-					   upstream->sg_str);
+				zlog_debug("sending pim register stop message :  (%s:%u:%u)%s ",
+					   PIM_DEBUG_VRF(upstream->pim->vrf), upstream->sg_str);
 			pim_register_stop_send(ifp, &sg, dest_addr, src_addr);
 			sentRegisterStop = 1;
 		} else {
 			if (PIM_DEBUG_PIM_REG)
-				zlog_debug("(%s) sptbit: %d", upstream->sg_str,
+				zlog_debug("((%s:%u:%u)%s) sptbit: %d",
+					   PIM_DEBUG_VRF(upstream->pim->vrf), upstream->sg_str,
 					   upstream->sptbit);
 		}
 		if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c
index 9bceb81bd8..4a3dd2e928 100644
--- a/pimd/pim_rp.c
+++ b/pimd/pim_rp.c
@@ -432,9 +432,9 @@ void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up)
 	if (!pim_addr_is_any(old_upstream_addr)) {
 		/* Deregister addr with Zebra NHT */
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: Deregister upstream %s addr %pPA with Zebra NHT",
-				__func__, up->sg_str, &old_upstream_addr);
+			zlog_debug("%s: Deregister upstream (%s:%u:%u)%s addr %pPA with Zebra NHT",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   &old_upstream_addr);
 		pim_nht_delete_tracked(pim, old_upstream_addr, up, NULL);
 	}

diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 1dca9acab1..a6c453ea1c 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -56,19 +56,17 @@ static void pim_rpf_cost_change(struct pim_instance *pim,

 	new_cost = pim_up_mlag_local_cost(up);
 	if (PIM_DEBUG_MLAG)
-		zlog_debug(
-			"%s: Cost_to_rp of upstream-%s changed to:%u, from:%u",
-			__func__, up->sg_str, new_cost, old_cost);
+		zlog_debug("%s: Cost_to_rp of upstream-(%s:%u:%u)%s changed to:%u, from:%u",
+			   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, new_cost, old_cost);

 	if (old_cost == new_cost)
 		return;

 	/* Cost changed, it might Impact MLAG DF election, update */
 	if (PIM_DEBUG_MLAG)
-		zlog_debug(
-			"%s: Cost_to_rp of upstream-%s changed to:%u",
-			__func__, up->sg_str,
-			rpf->source_nexthop.mrib_route_metric);
+		zlog_debug("%s: Cost_to_rp of upstream-(%s:%u:%u)%s changed to:%u", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+			   rpf->source_nexthop.mrib_route_metric);

 	if (pim_up_mlag_is_local(up))
 		pim_mlag_up_local_add(pim, up);
@@ -89,8 +87,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim, struct pim_upstream
 		return PIM_RPF_OK;

 	if (pim_addr_is_any(up->upstream_addr)) {
-		zlog_debug("%s(%s): RP is not configured yet for %s",
-			__func__, caller, up->sg_str);
+		zlog_debug("%s(%s): RP is not configured yet for (%s:%u:%u)%s", __func__, caller,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return PIM_RPF_OK;
 	}

@@ -121,8 +119,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim, struct pim_upstream

 	if (pim_rpf_addr_is_inaddr_any(rpf) && PIM_DEBUG_ZEBRA) {
 		/* RPF'(S,G) not found */
-		zlog_debug("%s(%s): RPF'%s not found: won't send join upstream",
-			   __func__, caller, up->sg_str);
+		zlog_debug("%s(%s): RPF'(%s:%u:%u)%s not found: won't send join upstream",
+			   __func__, caller, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		/* warning only */
 	}

@@ -131,8 +129,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim, struct pim_upstream
 		struct pim_neighbor *nbr;

 		if (PIM_DEBUG_ZEBRA) {
-			zlog_debug("%s(%s): (S,G)=%s RPF_interface(S) changed from %s to %s",
-				   __func__, caller, up->sg_str,
+			zlog_debug("%s(%s): (S,G)=(%s:%u:%u)%s RPF_interface(S) changed from %s to %s",
+				   __func__, caller, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
 				   saved.source_nexthop.interface ? saved.source_nexthop.interface->name
 								  : "<oldif?>",
 				   rpf->source_nexthop.interface ? rpf->source_nexthop.interface->name
@@ -153,8 +151,8 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim, struct pim_upstream
 	if (nexthop_mismatch(&rpf->source_nexthop, &saved.source_nexthop)) {

 		if (PIM_DEBUG_ZEBRA)
-			zlog_debug("%s(%s): (S,G)=%s source nexthop now is: interface=%s address=%pPAs pref=%d metric=%d",
-				   __func__, caller, up->sg_str,
+			zlog_debug("%s(%s): (S,G)=(%s:%u:%u)%s source nexthop now is: interface=%s address=%pPAs pref=%d metric=%d",
+				   __func__, caller, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
 				   rpf->source_nexthop.interface ? rpf->source_nexthop.interface->name
 								 : "<ifname?>",
 				   &rpf->source_nexthop.mrib_nexthop_addr,
@@ -176,10 +174,9 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim, struct pim_upstream
 	}

 	if (PIM_DEBUG_MLAG)
-		zlog_debug(
-			"%s(%s): Cost_to_rp of upstream-%s changed to:%u",
-			__func__, caller, up->sg_str,
-			rpf->source_nexthop.mrib_route_metric);
+		zlog_debug("%s(%s): Cost_to_rp of upstream-(%s:%u:%u)%s changed to:%u", __func__,
+			   caller, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+			   rpf->source_nexthop.mrib_route_metric);

 	pim_rpf_cost_change(pim, up, saved_mrib_route_metric);

@@ -271,8 +268,8 @@ static pim_addr pim_rpf_find_rpf_addr(struct pim_upstream *up)
 	pim_addr rpf_addr;

 	if (!up->rpf.source_nexthop.interface) {
-		zlog_warn("%s: missing RPF interface for upstream (S,G)=%s",
-			  __func__, up->sg_str);
+		zlog_warn("%s: missing RPF interface for upstream (S,G)=(%s:%u:%u)%s", __func__,
+			  PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 		return PIMADDR_ANY;
 	}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 49c7527b5e..1f00301ff1 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -200,9 +200,9 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
 #endif /* PIM_IPV == 4 */

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s(%s): Delete %s[%s] ref count: %d, flags: %d c_oil ref count %d (Pre decrement)",
-			   __func__, name, up->sg_str, pim->vrf->name, up->ref_count, up->flags,
-			   c_oil_ref_count);
+		zlog_debug("%s(%s): Delete (%s:%u:%u)%s[%s] ref count: %d, flags: %d c_oil ref count %d (Pre decrement)",
+			   __func__, name, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name,
+			   up->ref_count, up->flags, c_oil_ref_count);

 	 assert(up->ref_count > 0);

@@ -212,8 +212,8 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
 		return up;

 	if (PIM_DEBUG_TRACE)
-		zlog_debug("pim_upstream free vrf:%s %s flags 0x%x",
-			   pim->vrf->name, up->sg_str, up->flags);
+		zlog_debug("pim_upstream free vrf:%s (%s:%u:%u)%s flags 0x%x", pim->vrf->name,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, up->flags);

 	if (pim_up_mlag_is_local(up))
 		pim_mlag_up_local_del(pim, up);
@@ -280,9 +280,9 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
 	if (!pim_addr_is_any(up->upstream_addr)) {
 		/* Deregister addr with Zebra NHT */
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: Deregister upstream %s addr %pPA with Zebra NHT",
-				__func__, up->sg_str, &up->upstream_addr);
+			zlog_debug("%s: Deregister upstream (%s:%u:%u)%s addr %pPA with Zebra NHT",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   &up->upstream_addr);
 		pim_nht_delete_tracked(pim, up->upstream_addr, up, NULL);
 	}

@@ -295,19 +295,19 @@ void pim_upstream_send_join(struct pim_upstream *up)
 {
 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

 	if (PIM_DEBUG_PIM_TRACE) {
-		zlog_debug("%s: RPF'%s=%pPA(%s) for Interface %s", __func__,
-			   up->sg_str, &up->rpf.rpf_addr,
+		zlog_debug("%s: RPF'(%s:%u:%u)%s=%pPA(%s) for Interface %s", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &up->rpf.rpf_addr,
 			   pim_upstream_state2str(up->join_state),
 			   up->rpf.source_nexthop.interface->name);
 		if (pim_rpf_addr_is_inaddr_any(&up->rpf)) {
-			zlog_debug("%s: can't send join upstream: RPF'%s=%pPA",
-				   __func__, up->sg_str, &up->rpf.rpf_addr);
+			zlog_debug("%s: can't send join upstream: RPF'(%s:%u:%u)%s=%pPA", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &up->rpf.rpf_addr);
 			/* warning only */
 		}
 	}
@@ -327,7 +327,8 @@ static void on_graft_timer(struct event *t)

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__, up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -357,7 +358,8 @@ static void on_staterefresh_timer(struct event *t)

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__, up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -389,7 +391,8 @@ static void on_prune_timer(struct event *t)

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__, up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -402,10 +405,10 @@ static void on_prune_timer(struct event *t)
 	if ((up->channel_oil->cc.oldpktcnt >= up->channel_oil->cc.pktcnt) &&
 	    (up->channel_oil->cc.lastused / 100 > 30)) {
 		if (PIM_DEBUG_PIM_TRACE) {
-			zlog_debug("%s[%s]: %s old packet count is equal or lastused is greater than 30, (%ld,%ld,%lld)",
-				   __func__, up->sg_str, pim->vrf->name,
-				   up->channel_oil->cc.oldpktcnt, up->channel_oil->cc.pktcnt,
-				   up->channel_oil->cc.lastused / 100);
+			zlog_debug("%s[(%s:%u:%u)%s]: %s old packet count is equal or lastused is greater than 30, (%ld,%ld,%lld)",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   pim->vrf->name, up->channel_oil->cc.oldpktcnt,
+				   up->channel_oil->cc.pktcnt, up->channel_oil->cc.lastused / 100);
 		}
 		prune_timer_start(up);
 		return;
@@ -440,8 +443,8 @@ static void on_join_timer(struct event *t)

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -492,8 +495,9 @@ void prune_timer_start(struct pim_upstream *up)
 		nbr = pim_neighbor_find(up->rpf.source_nexthop.interface, up->rpf.rpf_addr, true);

 		if (PIM_DEBUG_PIM_EVENTS) {
-			zlog_debug("%s: starting %d sec timer for upstream (S,G)=%s", __func__,
-				   router->t_periodic, up->sg_str);
+			zlog_debug("%s: starting %d sec timer for upstream (S,G)=(%s:%u:%u)%s",
+				   __func__, router->t_periodic, PIM_DEBUG_VRF(up->pim->vrf),
+				   up->sg_str);
 		}
 	}

@@ -525,8 +529,8 @@ bool should_limit_prune(struct pim_upstream *up)
 void graft_timer_start(struct pim_upstream *up)
 {
 	if (PIM_DEBUG_PIM_EVENTS) {
-		zlog_debug("%s: starting %d sec timer for upstream (S,G)=%s", __func__,
-			   PIM_DEFAULT_GRAFT_RETRY_PERIOD, up->sg_str);
+		zlog_debug("%s: starting %d sec timer for upstream (S,G)=(%s:%u:%u)%s", __func__,
+			   PIM_DEFAULT_GRAFT_RETRY_PERIOD, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 	}

 	event_cancel(&up->t_graft_timer);
@@ -555,9 +559,9 @@ void join_timer_start(struct pim_upstream *up)

 	if (nbr) {
 		if (PIM_DEBUG_PIM_EVENTS) {
-			zlog_debug("%s: starting %d sec timer for upstream (S,G)=%s neighbor %pPA",
-				   __func__, pim_neigh_jp_period(nbr), up->sg_str,
-				   &nbr->source_addr);
+			zlog_debug("%s: starting %d sec timer for upstream (S,G)=(%s:%u:%u)%s neighbor %pPA",
+				   __func__, pim_neigh_jp_period(nbr), PIM_DEBUG_VRF(up->pim->vrf),
+				   up->sg_str, &nbr->source_addr);
 		}

 		pim_jp_agg_add_group(nbr->upstream_jp_agg, up, 1, nbr);
@@ -568,8 +572,8 @@ void join_timer_start(struct pim_upstream *up)
 			t_periodic = pim_if_jp_period(pim_interface);

 		if (PIM_DEBUG_PIM_EVENTS) {
-			zlog_debug("%s: starting %d sec timer for upstream (S,G)=%s", __func__,
-				   t_periodic, up->sg_str);
+			zlog_debug("%s: starting %d sec timer for upstream (S,G)=(%s:%u:%u)%s",
+				   __func__, t_periodic, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		}

 		event_cancel(&up->t_join_timer);
@@ -597,8 +601,8 @@ static void pim_upstream_join_timer_restart_msec(struct pim_upstream *up,
 						 int interval_msec)
 {
 	if (PIM_DEBUG_PIM_EVENTS) {
-		zlog_debug("%s: restarting %d msec timer for upstream (S,G)=%s",
-			   __func__, interval_msec, up->sg_str);
+		zlog_debug("%s: restarting %d msec timer for upstream (S,G)=(%s:%u:%u)%s",
+			   __func__, interval_msec, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 	}

 	event_cancel(&up->t_join_timer);
@@ -636,8 +640,8 @@ void pim_upstream_join_suppress(struct pim_upstream *up, pim_addr rpf,

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -660,17 +664,15 @@ void pim_upstream_join_suppress(struct pim_upstream *up, pim_addr rpf,
 	}

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug(
-			"%s %s: detected Join%s to RPF'(S,G)=%pPA: join_timer=%ld msec t_joinsuppress=%ld msec",
-			__FILE__, __func__, up->sg_str, &rpf,
-			join_timer_remain_msec, t_joinsuppress_msec);
+		zlog_debug("%s %s: detected Join(%s:%u:%u)%s to RPF'(S,G)=%pPA: join_timer=%ld msec t_joinsuppress=%ld msec",
+			   __FILE__, __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &rpf,
+			   join_timer_remain_msec, t_joinsuppress_msec);

 	if (join_timer_remain_msec < t_joinsuppress_msec) {
 		if (PIM_DEBUG_PIM_TRACE) {
-			zlog_debug(
-				"%s %s: suppressing Join(S,G)=%s for %ld msec",
-				__FILE__, __func__, up->sg_str,
-				t_joinsuppress_msec);
+			zlog_debug("%s %s: suppressing Join(S,G)=(%s:%u:%u)%s for %ld msec",
+				   __FILE__, __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   t_joinsuppress_msec);
 		}

 		if (nbr) {
@@ -690,8 +692,8 @@ void pim_upstream_join_timer_decrease_to_t_override(const char *debug_label,

 	if (!up->rpf.source_nexthop.interface) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -717,16 +719,15 @@ void pim_upstream_join_timer_decrease_to_t_override(const char *debug_label,
 	}

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug(
-			"%s: to RPF'%s=%pPA: join_timer=%ld msec t_override=%d msec",
-			debug_label, up->sg_str, &up->rpf.rpf_addr,
-			join_timer_remain_msec, t_override_msec);
+		zlog_debug("%s: to RPF'(%s:%u:%u)%s=%pPA: join_timer=%ld msec t_override=%d msec",
+			   debug_label, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &up->rpf.rpf_addr,
+			   join_timer_remain_msec, t_override_msec);

 	if (join_timer_remain_msec > t_override_msec) {
 		if (PIM_DEBUG_PIM_TRACE) {
-			zlog_debug(
-				"%s: decreasing (S,G)=%s join timer to t_override=%d msec",
-				debug_label, up->sg_str, t_override_msec);
+			zlog_debug("%s: decreasing (S,G)=(%s:%u:%u)%s join timer to t_override=%d msec",
+				   debug_label, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   t_override_msec);
 		}

 		pim_upstream_join_timer_restart_msec(up, t_override_msec);
@@ -776,8 +777,8 @@ int pim_upstream_could_register(struct pim_upstream *up)
 		pim_ifp = up->rpf.source_nexthop.interface->info;
 	else {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 	}

 	if (pim_ifp && PIM_I_am_DR(pim_ifp)
@@ -797,7 +798,8 @@ static void pim_upstream_transition_dm_to_sm(struct pim_instance *pim, struct pi
 		return;

 	if (PIM_DEBUG_PIM_EVENTS)
-		zlog_debug("Setting DM mroute %s to sparse", up->sg_str);
+		zlog_debug("Setting DM mroute (%s:%u:%u)%s to sparse", PIM_DEBUG_VRF(up->pim->vrf),
+			   up->sg_str);
 	/* Cancel stale DM timers before transitioning. */
 	if (up->t_prune_timer)
 		event_cancel(&up->t_prune_timer);
@@ -954,8 +956,8 @@ void pim_upstream_register_reevaluate(struct pim_instance *pim)
 		if (pim_is_grp_ssm(pim, up->sg.grp)) {
 			if (up->reg_state != PIM_REG_NOINFO || event_is_scheduled(up->t_rs_timer)) {
 				if (PIM_DEBUG_PIM_EVENTS)
-					zlog_debug("Clear register for %s as G is now SSM",
-						   up->sg_str);
+					zlog_debug("Clear register for (%s:%u:%u)%s as G is now SSM",
+						   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 				pim_upstream_register_clear(up);
 			}
 			continue;
@@ -976,7 +978,8 @@ void pim_upstream_register_reevaluate(struct pim_instance *pim)
 			}

 			if (PIM_DEBUG_PIM_EVENTS)
-				zlog_debug("%s RP(G) unknown; register state -> Join", up->sg_str);
+				zlog_debug("(%s:%u:%u)%s RP(G) unknown; register state -> Join",
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			event_cancel(&up->t_rs_timer);
 			pim_register_join(up);
 			continue;
@@ -985,7 +988,8 @@ void pim_upstream_register_reevaluate(struct pim_instance *pim)
 		/* register ASM sources with the RP */
 		if (up->reg_state == PIM_REG_NOINFO) {
 			if (PIM_DEBUG_PIM_EVENTS)
-				zlog_debug("Register %s as G is now ASM", up->sg_str);
+				zlog_debug("Register (%s:%u:%u)%s as G is now ASM",
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			pim_register_join(up);
 			continue;
 		}
@@ -994,8 +998,8 @@ void pim_upstream_register_reevaluate(struct pim_instance *pim)
 			continue;

 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_debug("RP(G) changed for %s from %pPA to %pPA", up->sg_str,
-				   &up->reg_rp, &rp_addr);
+			zlog_debug("RP(G) changed for (%s:%u:%u)%s from %pPA to %pPA",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &up->reg_rp, &rp_addr);

 		/* Join: the pimreg OIF stays. The next Register uses RP(G). */
 		if (up->reg_state == PIM_REG_JOIN) {
@@ -1063,9 +1067,9 @@ void pim_upstream_update_use_rpt(struct pim_upstream *up,
 	new_use_rpt = !!PIM_UPSTREAM_FLAG_TEST_USE_RPT(up->flags);
 	if (old_use_rpt != new_use_rpt) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_debug("%s switched from %s to %s", up->sg_str,
-				   old_use_rpt ? "RPT" : "SPT",
-				   new_use_rpt ? "RPT" : "SPT");
+			zlog_debug("(%s:%u:%u)%s switched from %s to %s",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   old_use_rpt ? "RPT" : "SPT", new_use_rpt ? "RPT" : "SPT");
 		if (update_mroute)
 			pim_upstream_mroute_add(up->channel_oil, __func__);
 	}
@@ -1093,21 +1097,21 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,

 	if (pim_addr_is_any(up->upstream_addr)) {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_debug("%s: RPF not configured for %s", __func__,
-				   up->sg_str);
+			zlog_debug("%s: RPF not configured for (%s:%u:%u)%s", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

 	if (!up->rpf.source_nexthop.interface)  {
 		if (PIM_DEBUG_PIM_EVENTS)
-			zlog_debug("%s: RP not reachable for %s", __func__,
-				   up->sg_str);
+			zlog_debug("%s: RP not reachable for (%s:%u:%u)%s", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

 	if (PIM_DEBUG_PIM_EVENTS) {
-		zlog_debug("%s: PIM_UPSTREAM_%s: (S,G) old: %s new: %s",
-			   __func__, up->sg_str,
+		zlog_debug("%s: PIM_UPSTREAM_(%s:%u:%u)%s: (S,G) old: %s new: %s", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
 			   pim_upstream_state2str(up->join_state),
 			   pim_upstream_state2str(new_state));
 	}
@@ -1307,9 +1311,8 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
 		    && PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up->parent->flags)) {
 			PIM_UPSTREAM_FLAG_SET_MLAG_NON_DF(up->flags);
 			if (PIM_DEBUG_VXLAN)
-				zlog_debug(
-					"upstream %s inherited mlag non-df flag from parent",
-					up->sg_str);
+				zlog_debug("upstream (%s:%u:%u)%s inherited mlag non-df flag from parent",
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		}
 	}

@@ -1337,9 +1340,8 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
 		if (rpf_result == PIM_RPF_FAILURE) {
 			up->channel_oil->oil_inherited_rescan = 1;
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug(
-					"%s: Attempting to create upstream(%s), Unable to RPF for source",
-					__func__, up->sg_str);
+				zlog_debug("%s: Attempting to create upstream((%s:%u:%u)%s), Unable to RPF for source",
+					   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		}

 		/* Consider a case where (S,G,rpt) prune is received and this
@@ -1366,10 +1368,9 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
 		pim_mlag_up_local_add(pim, up);

 	if (PIM_DEBUG_PIM_TRACE) {
-		zlog_debug(
-			"%s: Created Upstream %s upstream_addr %pPAs ref count %d increment",
-			__func__, up->sg_str, &up->upstream_addr,
-			up->ref_count);
+		zlog_debug("%s: Created Upstream (%s:%u:%u)%s upstream_addr %pPAs ref count %d increment",
+			   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &up->upstream_addr,
+			   up->ref_count);
 	}

 	return up;
@@ -1452,8 +1453,8 @@ void pim_upstream_ref(struct pim_upstream *up, int flags, const char *name)
 	up->flags |= flags;
 	++up->ref_count;
 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s(%s): upstream %s ref count %d increment",
-			   __func__, name, up->sg_str, up->ref_count);
+		zlog_debug("%s(%s): upstream (%s:%u:%u)%s ref count %d increment", __func__, name,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, up->ref_count);
 }

 struct pim_upstream *pim_upstream_add(struct pim_instance *pim, pim_sgaddr *sg,
@@ -1473,13 +1474,11 @@ struct pim_upstream *pim_upstream_add(struct pim_instance *pim, pim_sgaddr *sg,
 	}

 	if (PIM_DEBUG_PIM_TRACE) {
-		zlog_debug(
-			"%s(%s): %s, iif %pPA (%s) found: %d: ref_count: %d",
-			__func__, name, up->sg_str, &up->rpf.rpf_addr,
-			up->rpf.source_nexthop.interface ? up->rpf.source_nexthop
-								   .interface->name
-							 : "Unknown",
-			found, up->ref_count);
+		zlog_debug("%s(%s): (%s:%u:%u)%s, iif %pPA (%s) found: %d: ref_count: %d", __func__,
+			   name, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, &up->rpf.rpf_addr,
+			   up->rpf.source_nexthop.interface ? up->rpf.source_nexthop.interface->name
+							    : "Unknown",
+			   found, up->ref_count);
 	}

 	return up;
@@ -1669,12 +1668,10 @@ void pim_upstream_rpf_genid_changed(struct pim_instance *pim,
 		rpf_addr = up->rpf.rpf_addr;

 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: matching neigh=%pPA against upstream (S,G)=%s[%s] joined=%d rpf_addr=%pPA",
-				__func__, &neigh_addr, up->sg_str,
-				pim->vrf->name,
-				up->join_state == PIM_UPSTREAM_JOINED,
-				&rpf_addr);
+			zlog_debug("%s: matching neigh=%pPA against upstream (S,G)=(%s:%u:%u)%s[%s] joined=%d rpf_addr=%pPA",
+				   __func__, &neigh_addr, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   pim->vrf->name, up->join_state == PIM_UPSTREAM_JOINED,
+				   &rpf_addr);

 		/* consider only (S,G) upstream in Joined state */
 		if (up->join_state != PIM_UPSTREAM_JOINED)
@@ -1770,8 +1767,8 @@ static void pim_upstream_fhr_kat_expiry(struct pim_upstream *up)
 		return;

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("kat expired on %s; clear fhr reg state",
-			   up->sg_str);
+		zlog_debug("kat expired on (%s:%u:%u)%s; clear fhr reg state",
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 	pim_upstream_register_clear(up);
 	PIM_UPSTREAM_FLAG_UNSET_FHR(up->flags);
@@ -1784,9 +1781,8 @@ static void pim_upstream_fhr_kat_start(struct pim_upstream *up)
 {
 	if (pim_upstream_could_register(up)) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"kat started on %s; set fhr reg state to joined",
-				up->sg_str);
+			zlog_debug("kat started on (%s:%u:%u)%s; set fhr reg state to joined",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		if (!PIM_UPSTREAM_DM_TEST_INTERFACE(up->flags))
 			PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
 		if (up->reg_state == PIM_REG_NOINFO && !PIM_UPSTREAM_DM_TEST_INTERFACE(up->flags))
@@ -1837,9 +1833,8 @@ struct pim_upstream *pim_upstream_keep_alive_timer_proc(
 	if (PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) {
 		pim_upstream_fhr_kat_expiry(up);
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"kat expired on %s[%s]; remove stream reference",
-				up->sg_str, pim->vrf->name);
+			zlog_debug("kat expired on (%s:%u:%u)%s[%s]; remove stream reference",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name);
 		PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(up->flags);

 		/* Return if upstream entry got deleted.*/
@@ -1889,8 +1884,8 @@ void pim_upstream_keep_alive_timer_start(struct pim_upstream *up, uint32_t time)
 {
 	if (!PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("kat start on %s with no stream reference",
-				   up->sg_str);
+			zlog_debug("kat start on (%s:%u:%u)%s with no stream reference",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 	}
 	event_cancel(&up->t_ka_timer);
 	event_add_timer(router->master, pim_upstream_keep_alive_timer, up, time,
@@ -1988,8 +1983,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
 	// AND JoinDesired(S,G) == true
 	if (!pim_upstream_evaluate_join_desired(up->pim, up)) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: %s Join is not Desired", __func__,
-				   up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s Join is not Desired", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		return;
 	}

@@ -1997,8 +1992,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
 	if (pim_if_connected_to_source(up->rpf.source_nexthop.interface,
 				       up->sg.src)) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: %s is directly connected to the source",
-				   __func__, up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s is directly connected to the source",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
 		return;
 	}
@@ -2009,9 +2004,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
 			       .interface != starup->rpf.source_nexthop.interface) {
 		starup = up->parent;
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug(
-				"%s: %s RPF_interface(S) != RPF_interface(RP(G))",
-				__func__, up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s RPF_interface(S) != RPF_interface(RP(G))",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;

 		pim_jp_agg_single_upstream_send(&starup->rpf, starup, true);
@@ -2022,8 +2016,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
 	if (pim_upstream_is_sg_rpt(up)
 	    && pim_upstream_empty_inherited_olist(up)) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: %s OR inherited_olist(S,G,rpt) == NULL",
-				   __func__, up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s OR inherited_olist(S,G,rpt) == NULL",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
 		return;
 	}
@@ -2032,8 +2026,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,
 	//      ( RPF'(S,G) != NULL ) )
 	if (up->parent && pim_rpf_is_same(&up->rpf, &up->parent->rpf)) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: %s RPF'(S,G) is the same as RPF'(*,G)",
-				   __func__, up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s RPF'(S,G) is the same as RPF'(*,G)", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
 		return;
 	}
@@ -2084,17 +2078,16 @@ static void pim_upstream_register_stop_timer(struct event *t)

 	if (PIM_DEBUG_PIM_TRACE) {
 		char state_str[PIM_REG_STATE_STR_LEN];
-		zlog_debug("%s: (S,G)=%s[%s] upstream register stop timer %s",
-			   __func__, up->sg_str, pim->vrf->name,
-			   pim_reg_state2str(up->reg_state, state_str,
-					     sizeof(state_str)));
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s[%s] upstream register stop timer %s", __func__,
+			   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name,
+			   pim_reg_state2str(up->reg_state, state_str, sizeof(state_str)));
 	}

 	/* RP(G) went away. Leave suppression and do not arm another probe. */
 	if (up->reg_state != PIM_REG_NOINFO && pim_addr_is_any(pim_upstream_current_reg_rp(up))) {
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: %s RP(G) unknown; register state -> Join", __func__,
-				   up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s RP(G) unknown; register state -> Join",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		pim_register_join(up);
 		return;
 	}
@@ -2113,8 +2106,8 @@ static void pim_upstream_register_stop_timer(struct event *t)
 		/* This is equalent to Couldreg -> False */
 		if (!up->rpf.source_nexthop.interface) {
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug("%s: up %s RPF is not present",
-					   __func__, up->sg_str);
+				zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			pim_upstream_register_clear(up);
 			PIM_UPSTREAM_FLAG_UNSET_FHR(up->flags);
 			return;
@@ -2157,8 +2150,8 @@ static void pim_upstream_start_register_stop_timer(struct pim_upstream *up)
 	time = router->register_probe_time;

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: (S,G)=%s Starting upstream register stop timer %d",
-			   __func__, up->sg_str, time);
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s Starting upstream register stop timer %d",
+			   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, time);
 	event_add_timer(router->master, pim_upstream_register_stop_timer, up,
 			time, &up->t_rs_timer);
 }
@@ -2169,8 +2162,8 @@ static void pim_upstream_register_probe_timer(struct event *t)

 	if (pim_addr_is_any(pim_upstream_current_reg_rp(up))) {
 		if (PIM_DEBUG_PIM_REG)
-			zlog_debug("%s: %s RP(G) unknown; register state -> Join", __func__,
-				   up->sg_str);
+			zlog_debug("%s: (%s:%u:%u)%s RP(G) unknown; register state -> Join",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		pim_register_join(up);
 		return;
 	}
@@ -2184,7 +2177,8 @@ static void pim_upstream_register_probe_timer(struct event *t)
 		up->reg_state = PIM_REG_JOIN_PENDING;
 		if (PIM_DEBUG_PIM_TRACE) {
 			char state_str[PIM_REG_STATE_STR_LEN];
-			zlog_debug("%s: (S,G)=%s reg_state=%s", __func__, up->sg_str,
+			zlog_debug("%s: (S,G)=(%s:%u:%u)%s reg_state=%s", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
 				   pim_reg_state2str(up->reg_state, state_str, sizeof(state_str)));
 		}
 		pim_null_register_send(up);
@@ -2209,8 +2203,8 @@ void pim_upstream_start_register_probe_timer(struct pim_upstream *up)
 		time = 0;

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: (S,G)=%s Starting upstream register stop null probe timer %d",
-			   __func__, up->sg_str, time);
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s Starting upstream register stop null probe timer %d",
+			   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, time);

 	event_add_timer(router->master, pim_upstream_register_probe_timer, up,
 			time, &up->t_rs_timer);
@@ -2226,8 +2220,8 @@ int pim_upstream_inherited_olist_decide(struct pim_instance *pim,

 	if (!up->rpf.source_nexthop.interface)
 		if (PIM_DEBUG_PIM_TRACE)
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);

 	FOR_ALL_INTERFACES (pim->vrf, ifp) {
 		struct pim_interface *pim_ifp;
@@ -2330,17 +2324,16 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim, struct interface *ifp)
 	frr_each (rb_pim_upstream, &pim->upstream_head, up) {
 		if (pim_addr_is_any(up->upstream_addr)) {
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug(
-					"%s: RP not configured for Upstream %s",
-					__func__, up->sg_str);
+				zlog_debug("%s: RP not configured for Upstream (%s:%u:%u)%s",
+					   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			continue;
 		}

 		if (pim_rpf_addr_is_inaddr_any(&up->rpf) ||
 		    up->rpf.source_nexthop.interface == ifp) {
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug("%s: Upstream %s without a path to send join, or interface being used is getting a new neighbor, checking",
-					   __func__, up->sg_str);
+				zlog_debug("%s: Upstream (%s:%u:%u)%s without a path to send join, or interface being used is getting a new neighbor, checking",
+					   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 			old.source_nexthop.interface =
 				up->rpf.source_nexthop.interface;
 			rpf_result = pim_rpf_update(pim, up, &old, NULL, __func__);
@@ -2391,8 +2384,8 @@ bool pim_sg_is_reevaluate_oil_req(struct pim_instance *pim,
 		pim_ifp = up->rpf.source_nexthop.interface->info;
 	} else {
 		if (PIM_DEBUG_PIM_TRACE) {
-			zlog_debug("%s: up %s RPF is not present", __func__,
-				   up->sg_str);
+			zlog_debug("%s: up (%s:%u:%u)%s RPF is not present", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str);
 		}
 	}

@@ -2517,9 +2510,9 @@ static bool pim_upstream_sg_running_proc(struct pim_upstream *up)
 		if ((up->channel_oil->cc.oldpktcnt >= up->channel_oil->cc.pktcnt) &&
 		    (up->channel_oil->cc.lastused / 100 > 30)) {
 			if (PIM_DEBUG_PIM_TRACE) {
-				zlog_debug("%s[%s]: %s old packet count is equal or lastused is greater than 30, (%ld,%ld,%lld)",
-					   __func__, up->sg_str, pim->vrf->name,
-					   up->channel_oil->cc.oldpktcnt,
+				zlog_debug("%s[(%s:%u:%u)%s]: %s old packet count is equal or lastused is greater than 30, (%ld,%ld,%lld)",
+					   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+					   pim->vrf->name, up->channel_oil->cc.oldpktcnt,
 					   up->channel_oil->cc.pktcnt,
 					   up->channel_oil->cc.lastused / 100);
 			}
@@ -2528,9 +2521,9 @@ static bool pim_upstream_sg_running_proc(struct pim_upstream *up)
 	} else {
 		if (up->channel_oil->cc.oldpktcnt >= up->channel_oil->cc.pktcnt) {
 			if (PIM_DEBUG_PIM_TRACE) {
-				zlog_debug("%s[%s]: %s old packet count is equal, (%ld,%ld)",
-					   __func__, up->sg_str, pim->vrf->name,
-					   up->channel_oil->cc.oldpktcnt,
+				zlog_debug("%s[(%s:%u:%u)%s]: %s old packet count is equal, (%ld,%ld)",
+					   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+					   pim->vrf->name, up->channel_oil->cc.oldpktcnt,
 					   up->channel_oil->cc.pktcnt);
 			}
 			return rv;
@@ -2542,9 +2535,8 @@ static bool pim_upstream_sg_running_proc(struct pim_upstream *up)
 		 * one doesn't already exist */
 		if (!PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) {
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug(
-					"source reference created on kat restart %s[%s]",
-					up->sg_str, pim->vrf->name);
+				zlog_debug("source reference created on kat restart (%s:%u:%u)%s[%s]",
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name);

 			pim_upstream_ref(up, PIM_UPSTREAM_FLAG_MASK_SRC_STREAM,
 					 __func__);
@@ -2562,8 +2554,8 @@ static bool pim_upstream_sg_running_proc(struct pim_upstream *up)
 		    !PIM_UPSTREAM_DM_TEST_INTERFACE(up->flags) && pim->regiface &&
 		    pim->regiface->configured) {
 			if (PIM_DEBUG_PIM_TRACE)
-				zlog_debug("%s: add pimreg to %s[%s]", __func__, up->sg_str,
-					   pim->vrf->name);
+				zlog_debug("%s: add pimreg to (%s:%u:%u)%s[%s]", __func__,
+					   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name);
 			PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
 			pim_register_join(up);
 			pim_upstream_update_use_rpt(up, true /*update_mroute*/);
@@ -2596,8 +2588,8 @@ static void pim_upstream_sg_running(void *arg)
 	// No packet can have arrived here if this is the case
 	if (!up->channel_oil || !up->channel_oil->installed) {
 		if (PIM_DEBUG_TRACE)
-			zlog_debug("%s: %s[%s] is not installed in mroute",
-				   __func__, up->sg_str, pim->vrf->name);
+			zlog_debug("%s: (%s:%u:%u)%s[%s] is not installed in mroute", __func__,
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str, pim->vrf->name);
 		return;
 	}

@@ -2611,9 +2603,9 @@ static void pim_upstream_sg_running(void *arg)
 	 */
 	if (pim_sg_is_reevaluate_oil_req(pim, up)) {
 		if (PIM_DEBUG_TRACE)
-			zlog_debug(
-				"%s: Handling unscanned inherited_olist for %s[%s]",
-				__func__, up->sg_str, pim->vrf->name);
+			zlog_debug("%s: Handling unscanned inherited_olist for (%s:%u:%u)%s[%s]",
+				   __func__, PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   pim->vrf->name);
 		pim_upstream_inherited_olist_decide(pim, up);
 		up->channel_oil->oil_inherited_rescan = 0;
 	}
diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c
index 5bba9bb138..3c1cf4cf0f 100644
--- a/pimd/pim_vxlan.c
+++ b/pimd/pim_vxlan.c
@@ -42,15 +42,16 @@ static void pim_vxlan_rp_send_null_register_startup(struct event *e)

 	if (vxlan_sg->null_register_sent > PIM_VXLAN_STARTUP_NULL_REGISTERS) {
 		if (PIM_DEBUG_VXLAN)
-			zlog_debug("Null registering stopping for %s",
-				   vxlan_sg->sg_str);
+			zlog_debug("Null registering stopping for (%s:%u:%u)%s",
+				   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 		return;
 	}

 	pim_null_register_send(vxlan_sg->up);

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("Sent null register for %s", vxlan_sg->sg_str);
+		zlog_debug("Sent null register for (%s:%u:%u)%s",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 	event_add_timer(router->master, pim_vxlan_rp_send_null_register_startup,
 			vxlan_sg, PIM_VXLAN_WORK_TIME, &vxlan_sg->null_register);
@@ -86,8 +87,8 @@ void pim_vxlan_rp_info_is_alive(struct pim_instance *pim,
 		 */
 		if (rpg == rpg_changed) {
 			if (PIM_DEBUG_VXLAN)
-				zlog_debug("VXLAN RP info for %s alive sending",
-					   vxlan_sg->sg_str);
+				zlog_debug("VXLAN RP info for (%s:%u:%u)%s alive sending",
+					   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 			vxlan_sg->null_register_sent = 0;
 			event_add_event(router->master,
 					pim_vxlan_rp_send_null_register_startup,
@@ -133,8 +134,8 @@ static void pim_vxlan_do_reg_work(void)

 		if (vxlan_sg->up && (vxlan_sg->up->reg_state == PIM_REG_JOIN)) {
 			if (PIM_DEBUG_VXLAN)
-				zlog_debug("vxlan SG %s periodic NULL register",
-						vxlan_sg->sg_str);
+				zlog_debug("vxlan SG (%s:%u:%u)%s periodic NULL register",
+					   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 			/*
 			 * If we are on the work queue *and* the rpf
@@ -181,8 +182,8 @@ static void pim_vxlan_add_work(struct pim_vxlan_sg *vxlan_sg)
 {
 	if (vxlan_sg->flags & PIM_VXLAN_SGF_DEL_IN_PROG) {
 		if (PIM_DEBUG_VXLAN)
-			zlog_debug("vxlan SG %s skip work list; del-in-prog",
-					vxlan_sg->sg_str);
+			zlog_debug("vxlan SG (%s:%u:%u)%s skip work list; del-in-prog",
+				   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 		return;
 	}

@@ -193,8 +194,8 @@ static void pim_vxlan_add_work(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s work list add",
-				vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s work list add",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 	vxlan_sg->work_node = listnode_add(vxlan_info.work_list, vxlan_sg);
 	/* XXX: adjust max_work_cnt if needed */
 }
@@ -205,8 +206,8 @@ static void pim_vxlan_del_work(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s work list del",
-				vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s work list del",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 	if (vxlan_sg->work_node == vxlan_info.next_work)
 		vxlan_info.next_work = vxlan_sg->work_node->next;
@@ -236,8 +237,8 @@ void pim_vxlan_update_sg_reg_state(struct pim_instance *pim,
 		 * there is no need to keep spamming it
 		 */
 		if (PIM_DEBUG_VXLAN)
-			zlog_debug("Received Register stop for %s",
-				   vxlan_sg->sg_str);
+			zlog_debug("Received Register stop for (%s:%u:%u)%s",
+				   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 		event_cancel(&vxlan_sg->null_register);
 		pim_vxlan_del_work(vxlan_sg);
@@ -280,8 +281,8 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s orig mroute-up del",
-			vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s orig mroute-up del",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 	vxlan_sg->up = NULL;

@@ -318,9 +319,9 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
 			r = pim_rpf_update(vxlan_sg->pim, up, NULL, NULL, __func__);
 			if (r == PIM_RPF_FAILURE) {
 				if (PIM_DEBUG_VXLAN)
-					zlog_debug(
-						"vxlan SG %s rpf_update failure",
-						vxlan_sg->sg_str);
+					zlog_debug("vxlan SG (%s:%u:%u)%s rpf_update failure",
+						   PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+						   vxlan_sg->sg_str);
 			}
 		}
 	}
@@ -333,10 +334,9 @@ static void pim_vxlan_orig_mr_up_iif_update(struct pim_vxlan_sg *vxlan_sg)
 	pim_upstream_mroute_iif_update(vxlan_sg->up->channel_oil, __func__);

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s orig mroute-up updated with iif %s",
-			vxlan_sg->sg_str,
-			vxlan_sg->iif?vxlan_sg->iif->name:"-");
-
+		zlog_debug("vxlan SG (%s:%u:%u)%s orig mroute-up updated with iif %s",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str,
+			   vxlan_sg->iif ? vxlan_sg->iif->name : "-");
 }

 /* For every VxLAN BUM multicast group we setup a SG-up that has the following
@@ -371,9 +371,9 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
 	}

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s orig mroute-up add with iif %s",
-			vxlan_sg->sg_str,
-			vxlan_sg->iif?vxlan_sg->iif->name:"-");
+		zlog_debug("vxlan SG (%s:%u:%u)%s orig mroute-up add with iif %s",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str,
+			   vxlan_sg->iif ? vxlan_sg->iif->name : "-");

 	PIM_UPSTREAM_FLAG_SET_SRC_VXLAN_ORIG(flags);
 	/* pin the IIF to lo or peerlink-subinterface and disable NHT */
@@ -436,8 +436,8 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)

 	if (!up) {
 		if (PIM_DEBUG_VXLAN)
-			zlog_debug("vxlan SG %s orig mroute-up add failed",
-					vxlan_sg->sg_str);
+			zlog_debug("vxlan SG (%s:%u:%u)%s orig mroute-up add failed",
+				   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 		return;
 	}

@@ -477,8 +477,8 @@ static void pim_vxlan_orig_mr_oif_add(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s oif %s add",
-			vxlan_sg->sg_str, vxlan_sg->orig_oif->name);
+		zlog_debug("vxlan SG (%s:%u:%u)%s oif %s add", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str, vxlan_sg->orig_oif->name);

 	vxlan_sg->flags |= PIM_VXLAN_SGF_OIF_INSTALLED;
 	pim_channel_add_oif(vxlan_sg->up->channel_oil,
@@ -497,8 +497,8 @@ static void pim_vxlan_orig_mr_oif_del(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s oif %s del",
-			vxlan_sg->sg_str, orig_oif->name);
+		zlog_debug("vxlan SG (%s:%u:%u)%s oif %s del", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str, orig_oif->name);

 	vxlan_sg->flags &= ~PIM_VXLAN_SGF_OIF_INSTALLED;
 	pim_channel_del_oif(vxlan_sg->up->channel_oil,
@@ -553,7 +553,8 @@ static void pim_vxlan_orig_mr_add(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s orig-mr add", vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s orig-mr add", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str);

 	pim_vxlan_orig_mr_install(vxlan_sg);
 }
@@ -561,7 +562,8 @@ static void pim_vxlan_orig_mr_add(struct pim_vxlan_sg *vxlan_sg)
 static void pim_vxlan_orig_mr_del(struct pim_vxlan_sg *vxlan_sg)
 {
 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s orig-mr del", vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s orig-mr del", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str);

 	pim_vxlan_orig_mr_oif_del(vxlan_sg);
 	pim_vxlan_orig_mr_up_del(vxlan_sg);
@@ -578,10 +580,9 @@ static void pim_vxlan_orig_mr_iif_update(struct hash_bucket *bucket, void *arg)

 	ifp = pim_vxlan_orig_mr_iif_get(vxlan_sg->pim);
 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s iif changed from %s to %s",
-				vxlan_sg->sg_str,
-				old_iif ? old_iif->name : "-",
-				ifp ? ifp->name : "-");
+		zlog_debug("vxlan SG (%s:%u:%u)%s iif changed from %s to %s",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str,
+			   old_iif ? old_iif->name : "-", ifp ? ifp->name : "-");

 	if (pim_vxlan_orig_mr_add_is_ok(vxlan_sg)) {
 		if (vxlan_sg->up) {
@@ -619,8 +620,9 @@ static void pim_vxlan_term_mr_oif_add(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s term-oif %s add",
-			vxlan_sg->sg_str, vxlan_sg->term_oif->name);
+		zlog_debug("vxlan SG (%s:%u:%u)%s term-oif %s add",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str,
+			   vxlan_sg->term_oif->name);

 	if (pim_ifchannel_local_membership_add(vxlan_sg->term_oif,
 				&vxlan_sg->sg, true /*is_vxlan */)) {
@@ -633,8 +635,9 @@ static void pim_vxlan_term_mr_oif_add(struct pim_vxlan_sg *vxlan_sg)
 		 */
 		pim_upstream_inherited_olist(vxlan_sg->pim, vxlan_sg->up);
 	} else {
-		zlog_warn("vxlan SG %s term-oif %s add failed",
-			vxlan_sg->sg_str, vxlan_sg->term_oif->name);
+		zlog_warn("vxlan SG (%s:%u:%u)%s term-oif %s add failed",
+			  PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str,
+			  vxlan_sg->term_oif->name);
 	}
 }

@@ -644,8 +647,8 @@ static void pim_vxlan_term_mr_oif_del(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s oif %s del",
-			vxlan_sg->sg_str, vxlan_sg->term_oif->name);
+		zlog_debug("vxlan SG (%s:%u:%u)%s oif %s del", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str, vxlan_sg->term_oif->name);

 	vxlan_sg->flags &= ~PIM_VXLAN_SGF_OIF_INSTALLED;
 	pim_ifchannel_local_membership_del(vxlan_sg->term_oif, &vxlan_sg->sg);
@@ -699,8 +702,8 @@ static void pim_vxlan_term_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
 	}

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s term mroute-up add",
-			vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s term mroute-up add",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 	PIM_UPSTREAM_FLAG_SET_SRC_VXLAN_TERM(flags);
 	/* enable MLAG designated-forwarder election on termination mroutes */
@@ -711,8 +714,8 @@ static void pim_vxlan_term_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
 	vxlan_sg->up = up;

 	if (!up) {
-		zlog_warn("vxlan SG %s term mroute-up add failed",
-			vxlan_sg->sg_str);
+		zlog_warn("vxlan SG (%s:%u:%u)%s term mroute-up add failed",
+			  PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 		return;
 	}

@@ -728,8 +731,8 @@ static void pim_vxlan_term_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s term mroute-up del",
-			vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s term mroute-up del",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);
 	vxlan_sg->up = NULL;
 	if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM) {
 		/* update SG entries that are inheriting from this XG entry */
@@ -746,7 +749,8 @@ static void pim_vxlan_term_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
 static void pim_vxlan_term_mr_add(struct pim_vxlan_sg *vxlan_sg)
 {
 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s term mroute add", vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s term mroute add",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 	vxlan_sg->term_oif = vxlan_sg->pim->vxlan.term_if;
 	if (!vxlan_sg->term_oif)
@@ -761,7 +765,8 @@ static void pim_vxlan_term_mr_add(struct pim_vxlan_sg *vxlan_sg)
 static void pim_vxlan_term_mr_del(struct pim_vxlan_sg *vxlan_sg)
 {
 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s term mroute del", vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s term mroute del",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str);

 	/* remove local membership associated with the term oif */
 	pim_vxlan_term_mr_oif_del(vxlan_sg);
@@ -797,7 +802,8 @@ static struct pim_vxlan_sg *pim_vxlan_sg_new(struct pim_instance *pim,
 	snprintfrr(vxlan_sg->sg_str, sizeof(vxlan_sg->sg_str), "%pSG", sg);

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s alloc", vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s alloc", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str);

 	vxlan_sg = hash_get(pim->vxlan.sg_hash, vxlan_sg, hash_alloc_intern);

@@ -851,7 +857,8 @@ static void pim_vxlan_sg_del_item(struct pim_vxlan_sg *vxlan_sg)
 		pim_vxlan_term_mr_del(vxlan_sg);

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s free", vxlan_sg->sg_str);
+		zlog_debug("vxlan SG (%s:%u:%u)%s free", PIM_DEBUG_VRF(vxlan_sg->pim->vrf),
+			   vxlan_sg->sg_str);

 	XFREE(MTYPE_PIM_VXLAN_SG, vxlan_sg);
 }
@@ -1015,12 +1022,10 @@ static void pim_vxlan_up_cost_update(struct pim_instance *pim,
 			 (up->rpf.source_nexthop.interface ==
 			  old_peerlink_rif))) {
 		if (PIM_DEBUG_VXLAN)
-			zlog_debug("RPF cost adjust for %s on peerlink-rif (old: %s, new: %s) change",
-					up->sg_str,
-					old_peerlink_rif ?
-					old_peerlink_rif->name : "-",
-					pim->vxlan.peerlink_rif ?
-					pim->vxlan.peerlink_rif->name : "-");
+			zlog_debug("RPF cost adjust for (%s:%u:%u)%s on peerlink-rif (old: %s, new: %s) change",
+				   PIM_DEBUG_VRF(up->pim->vrf), up->sg_str,
+				   old_peerlink_rif ? old_peerlink_rif->name : "-",
+				   pim->vxlan.peerlink_rif ? pim->vxlan.peerlink_rif->name : "-");
 		pim_mlag_up_local_add(pim, up);
 	}
 }
@@ -1119,10 +1124,10 @@ static void pim_vxlan_term_mr_oif_update(struct hash_bucket *bucket, void *arg)
 		return;

 	if (PIM_DEBUG_VXLAN)
-		zlog_debug("vxlan SG %s term oif changed from %s to %s",
-			vxlan_sg->sg_str,
-			vxlan_sg->term_oif ? vxlan_sg->term_oif->name : "-",
-			ifp ? ifp->name : "-");
+		zlog_debug("vxlan SG (%s:%u:%u)%s term oif changed from %s to %s",
+			   PIM_DEBUG_VRF(vxlan_sg->pim->vrf), vxlan_sg->sg_str,
+			   vxlan_sg->term_oif ? vxlan_sg->term_oif->name : "-",
+			   ifp ? ifp->name : "-");

 	pim_vxlan_term_mr_del(vxlan_sg);
 	vxlan_sg->term_oif = ifp;
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index b1aa406f95..d7684e706e 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -485,7 +485,8 @@ void pim_forward_stop(struct pim_ifchannel *origch)
 	pim_ifchannel_find(origch->interface, &origch->sg, &ch, &chrpt);

 	if (PIM_DEBUG_PIM_TRACE)
-		zlog_debug("%s: (S,G)=%s oif=%s installed: %d", __func__, origch->sg_str,
+		zlog_debug("%s: (S,G)=(%s:%u:%u)%s oif=%s installed: %d", __func__,
+			   PIM_DEBUG_VRF(origch->interface->vrf), origch->sg_str,
 			   origch->interface->name, up->channel_oil->installed);

 	/*
diff --git a/tests/topotests/msdp_topo1/test_msdp_topo1.py b/tests/topotests/msdp_topo1/test_msdp_topo1.py
index 5b68fa6f33..827491f711 100755
--- a/tests/topotests/msdp_topo1/test_msdp_topo1.py
+++ b/tests/topotests/msdp_topo1/test_msdp_topo1.py
@@ -565,7 +565,10 @@ def test_msdp_log_events():
         peer_ok = re.search(
             "MSDP peer 192.168.1.2 state changed to established", r1_log
         )
-        sa_ok = re.search(r"MSDP SA \(192.168.10.100\,229.1.2.3\) created", r1_log)
+        sa_ok = re.search(
+            r"MSDP SA \(\S+:\d+:\d+\)\(192\.168\.10\.100,229\.1\.2\.3\) created",
+            r1_log,
+        )
         return peer_ok is not None and sa_ok is not None

     _, result = topotest.run_and_expect(check_msdp_log_messages, True, count=30, wait=1)