From 20d599ae34d860036f66d9fa7b07c0c3b742734d Mon Sep 17 00:00:00 2001 From: Juan Font Date: Sat, 26 Nov 2022 00:01:51 +0000 Subject: [PATCH] Add more logging --- routes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes.go b/routes.go index 95d93ac1..f59a6039 100644 --- a/routes.go +++ b/routes.go @@ -223,6 +223,10 @@ func (h *Headscale) handlePrimarySubnetFailover() error { if !route.IsPrimary { _, err := h.getPrimaryRoute(netip.Prefix(route.Prefix)) if h.isUniquePrefix(route) || errors.Is(err, gorm.ErrRecordNotFound) { + log.Info(). + Str("prefix", netip.Prefix(route.Prefix).String()). + Str("machine", route.Machine.GivenName). + Msg("Setting primary route") routes[pos].IsPrimary = true err := h.db.Save(&routes[pos]).Error if err != nil {