diff --git a/pkg/storage/utils/metadata/cs3.go b/pkg/storage/utils/metadata/cs3.go index c6e3aa8a406..68795661c00 100644 --- a/pkg/storage/utils/metadata/cs3.go +++ b/pkg/storage/utils/metadata/cs3.go @@ -222,11 +222,13 @@ func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, md, _ := metadata.FromOutgoingContext(ctx) httpReq.Header.Add(ctxpkg.TokenHeader, md.Get(ctxpkg.TokenHeader)[0]) - fmt.Println("cs3.dataGatewayClient.Do") log.Info().Str("path", req.Path).Msg("cs3.Upload dataGatewayClient.Do...") resp, err := cs3.dataGatewayClient.Do(httpReq) - log.Info().Str("path", req.Path).Interface("err", err).Interface("resp", resp).Msg("cs3.Upload dataGatewayClient.Do done") - fmt.Printf("cs3.dataGatewayClient.Do err=%v\n", err) + le := log.Info().Str("path", req.Path).Interface("err", err) + if resp != nil { + le = le.Int("code", resp.StatusCode).Str("status", resp.Status) + } + le.Msg("cs3.Upload dataGatewayClient.Do done") if err != nil { log.Info().Str("path", req.Path).Msg("cs3.Upload 0") return nil, err @@ -234,8 +236,8 @@ func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, log.Info().Str("path", req.Path).Msg("cs3.Upload 1") defer func() { log.Info().Str("path", req.Path).Msg("cs3.Upload closing body") - resp.Body.Close() - log.Info().Str("path", req.Path).Msg("cs3.Upload closed body") + cerr := resp.Body.Close() + log.Info().Interface("err", cerr).Str("path", req.Path).Msg("cs3.Upload closed body") }() log.Info().Str("path", req.Path).Msg("cs3.Upload 2") if err := errtypes.NewErrtypeFromHTTPStatusCode(resp.StatusCode, httpReq.URL.Path); err != nil { @@ -248,7 +250,7 @@ func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, if ocEtag := resp.Header.Get("OC-ETag"); ocEtag != "" { etag = ocEtag } - log.Info().Str("path", req.Path).Err(err).Msg("cs3.Upload returning from cs3.Upload") + log.Info().Str("path", req.Path).Interface("err", err).Msg("cs3.Upload returning from cs3.Upload") return &UploadResponse{ Etag: etag, }, nil