From 095379fa60987cd54771cfa846e97124fe2b11a1 Mon Sep 17 00:00:00 2001 From: Alisdair MacLeod Date: Mon, 2 Feb 2026 10:27:20 +0000 Subject: [PATCH] add logging to domain validation --- .../modules/reverseproxy/domain/manager.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/management/internals/modules/reverseproxy/domain/manager.go b/management/internals/modules/reverseproxy/domain/manager.go index 1a809d709..dac79fbc8 100644 --- a/management/internals/modules/reverseproxy/domain/manager.go +++ b/management/internals/modules/reverseproxy/domain/manager.go @@ -6,6 +6,7 @@ import ( "net" "github.com/netbirdio/netbird/management/server/types" + log "github.com/sirupsen/logrus" ) type domainType string @@ -128,7 +129,10 @@ func (m Manager) DeleteDomain(ctx context.Context, accountID, domainID string) e func (m Manager) ValidateDomain(accountID, domainID string) { d, err := m.store.GetCustomDomain(context.Background(), accountID, domainID) if err != nil { - // TODO: something? Log? + log.WithFields(log.Fields{ + "accountID": accountID, + "domainID": domainID, + }).WithError(err).Error("get custom domain from store") return } var reverseProxyAddresses []string @@ -136,9 +140,18 @@ func (m Manager) ValidateDomain(accountID, domainID string) { reverseProxyAddresses = m.proxyURLProvider.GetConnectedProxyURLs() } if m.validator.IsValid(context.Background(), d.Domain, reverseProxyAddresses) { + log.WithFields(log.Fields{ + "accountID": accountID, + "domainID": domainID, + "domain": d.Domain, + }).Debug("domain validated successfully") d.Validated = true if _, err := m.store.UpdateCustomDomain(context.Background(), accountID, d); err != nil { - // TODO: something? Log? + log.WithFields(log.Fields{ + "accountID": accountID, + "domainID": domainID, + "domain": d.Domain, + }).WithError(err).Error("update custom domain in store") return } }