From 526a126a5ac39f3c4179e28578454796c4356331 Mon Sep 17 00:00:00 2001 From: Fadila Date: Mon, 2 Dec 2019 15:39:19 +0100 Subject: [PATCH] Satellite: log the project information for upload, download, and list activities (#3651) --- satellite/metainfo/metainfo.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/satellite/metainfo/metainfo.go b/satellite/metainfo/metainfo.go index b39e00bbe..ee9e3c3f0 100644 --- a/satellite/metainfo/metainfo.go +++ b/satellite/metainfo/metainfo.go @@ -1293,6 +1293,7 @@ func (endpoint *Endpoint) GetObject(ctx context.Context, req *pb.ObjectGetReques index++ } } + endpoint.log.Info("Get Object", zap.Stringer("Project ID", keyInfo.ProjectID)) return &pb.ObjectGetResponse{ Object: object, @@ -1341,6 +1342,7 @@ func (endpoint *Endpoint) ListObjects(ctx context.Context, req *pb.ObjectListReq items[i].ExpiresAt = segment.Pointer.ExpirationDate } } + endpoint.log.Info("List Objects", zap.Stringer("Project ID", keyInfo.ProjectID)) return &pb.ObjectListResponse{ Items: items, @@ -1394,6 +1396,7 @@ func (endpoint *Endpoint) BeginDeleteObject(ctx context.Context, req *pb.ObjectB return nil, err } + endpoint.log.Info("Delete Object", zap.Stringer("Project ID", keyInfo.ProjectID)) return &pb.ObjectBeginDeleteResponse{ StreamId: streamID, }, nil @@ -1500,6 +1503,8 @@ func (endpoint *Endpoint) BeginSegment(ctx context.Context, req *pb.SegmentBegin CreationDate: time.Now(), }) + endpoint.log.Info("Segment Upload", zap.Stringer("Project ID", keyInfo.ProjectID)) + return &pb.SegmentBeginResponse{ SegmentId: segmentID, AddressedLimits: addressedLimits, @@ -1719,6 +1724,8 @@ func (endpoint *Endpoint) MakeInlineSegment(ctx context.Context, req *pb.Segment return nil, rpcstatus.Error(rpcstatus.Internal, err.Error()) } + endpoint.log.Info("Make Inline Segment", zap.Stringer("Project ID", keyInfo.ProjectID)) + return &pb.SegmentMakeInlineResponse{}, nil } @@ -1770,6 +1777,8 @@ func (endpoint *Endpoint) BeginDeleteSegment(ctx context.Context, req *pb.Segmen CreationDate: time.Now(), }) + endpoint.log.Info("Delete Segment", zap.Stringer("Project ID", keyInfo.ProjectID)) + return &pb.SegmentBeginDeleteResponse{ SegmentId: segmentID, AddressedLimits: limits, @@ -1846,6 +1855,8 @@ func (endpoint *Endpoint) ListSegments(ctx context.Context, req *pb.SegmentListR return nil, rpcstatus.Error(rpcstatus.Internal, err.Error()) } + endpoint.log.Info("List Segments", zap.Stringer("Project ID", keyInfo.ProjectID)) + if streamMeta.NumberOfSegments > 0 { // use unencrypted number of segments // TODO cleanup int32 vs int64 @@ -2014,6 +2025,7 @@ func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDo if err != nil { return nil, rpcstatus.Error(rpcstatus.Internal, err.Error()) } + endpoint.log.Info("Download Segment", zap.Stringer("Project ID", keyInfo.ProjectID)) return &pb.SegmentDownloadResponse{ SegmentId: segmentID, SegmentSize: pointer.SegmentSize, @@ -2037,6 +2049,8 @@ func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDo } } + endpoint.log.Info("Download Segment", zap.Stringer("Project ID", keyInfo.ProjectID)) + return &pb.SegmentDownloadResponse{ SegmentId: segmentID, AddressedLimits: limits,