diff --git a/lib/rdbms/scan/scan.go b/lib/rdbms/scan/scan.go index 528152c1..5be611c5 100644 --- a/lib/rdbms/scan/scan.go +++ b/lib/rdbms/scan/scan.go @@ -7,6 +7,7 @@ import ( "github.com/artie-labs/reader/lib/rdbms/primary_key" "github.com/artie-labs/transfer/lib/retry" + "gorm.io/gorm/logger" ) const ( @@ -106,12 +107,7 @@ func (s *Scanner) Next() ([]map[string]any, error) { func (s *Scanner) scan() ([]map[string]any, error) { query, parameters := s.adapter.BuildQuery(s.primaryKeys.Keys(), s.isFirstBatch, s.batchSize) - - logger := slog.With(slog.String("query", query)) - if len(parameters) > 0 { - logger = logger.With(slog.Any("parameters", parameters)) - } - logger.Info("Scan query") + logger.Info("Scan query", slog.String("query", query), slog.Any("parameters", parameters)) rows, err := retry.WithRetriesAndResult(s.retryCfg, func(_ int, _ error) (*sql.Rows, error) { return s.db.Query(query, parameters...)