From ba305a757c9df92f293dbfc38fbbc2da3199e5a1 Mon Sep 17 00:00:00 2001 From: dgghinea-axway Date: Fri, 9 Aug 2024 15:47:04 +0300 Subject: [PATCH] add logger --- pkg/apic/servicebody.go | 3 +++ pkg/apic/servicebuilder.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pkg/apic/servicebody.go b/pkg/apic/servicebody.go index ebb3ffcb4..99274fbb8 100644 --- a/pkg/apic/servicebody.go +++ b/pkg/apic/servicebody.go @@ -3,6 +3,7 @@ package apic import ( management "github.com/Axway/agent-sdk/pkg/apic/apiserver/models/management/v1alpha1" "github.com/Axway/agent-sdk/pkg/apic/provisioning" + "github.com/Axway/agent-sdk/pkg/util/log" ) // APIKeyInfo - @@ -64,6 +65,7 @@ type ServiceBody struct { isDesignDataplane bool referencedServiceName string referencedInstanceName string + logger log.FieldLogger } // SetAccessRequestDefinitionName - set the name of the access request definition for this service body @@ -118,6 +120,7 @@ func (s *ServiceBody) GetAccessRequestDefinition() *management.AccessRequestDefi func (s *ServiceBody) createAccessRequestDefinition() error { if !s.uniqueARD { + s.logger.WithField("ardName", s.ardName).Debug("skipping registering new ARD") return nil } oauthScopes := make([]string, 0) diff --git a/pkg/apic/servicebuilder.go b/pkg/apic/servicebuilder.go index 77fc9e7cb..8e5ddc71c 100644 --- a/pkg/apic/servicebuilder.go +++ b/pkg/apic/servicebuilder.go @@ -6,6 +6,7 @@ import ( "github.com/Axway/agent-sdk/pkg/apic/provisioning" "github.com/Axway/agent-sdk/pkg/config" + "github.com/Axway/agent-sdk/pkg/util/log" ) const ( @@ -97,6 +98,7 @@ func NewServiceBodyBuilder() ServiceBuilder { InstanceAgentDetails: make(map[string]interface{}), RevisionAgentDetails: make(map[string]interface{}), requestDefinitionsAllowed: true, + logger: log.NewFieldLogger().WithPackage("sdk.apic").WithComponent("serviceBuilder"), }, } }