From 64e9702502dae4c319f52707c97d930019c47afa Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Wed, 24 Sep 2025 18:15:54 +0200 Subject: [PATCH] chore: improve logging Signed-off-by: Marco Nenciarini --- internal/cnpgi/common/wal.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/cnpgi/common/wal.go b/internal/cnpgi/common/wal.go index 0ccc1ac..e15e987 100644 --- a/internal/cnpgi/common/wal.go +++ b/internal/cnpgi/common/wal.go @@ -88,11 +88,14 @@ func (w WALServiceImplementation) Archive( ctx context.Context, request *wal.WALArchiveRequest, ) (*wal.WALArchiveResult, error) { - contextLogger := log.FromContext(ctx) - contextLogger.Debug("starting wal archive") - baseWalName := path.Base(request.GetSourceFileName()) + contextLogger := log.FromContext(ctx) + contextLogger.Debug("wal archive start", "walName", baseWalName) + defer func() { + contextLogger.Debug("wal archive end", "walName", baseWalName) + }() + // Step 1: parse the configuration and get the environment variables needed // for barman-cloud-wal-archive configuration, err := config.NewFromClusterJSON(request.ClusterDefinition) @@ -115,6 +118,7 @@ func (w WALServiceImplementation) Archive( ) if err != nil { if apierrors.IsForbidden(err) { + contextLogger.Info(ErrMissingPermissions.Error()) return nil, ErrMissingPermissions } return nil, err