[go: up one dir, main page]

Skip to content

Commit

Permalink
Updates to endorser and gateway logging
Browse files Browse the repository at this point in the history
Update endorser and gateway log levels to improve troubleshooting.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart authored and C0rWin committed Nov 18, 2021
1 parent 34dcb8d commit a1c13d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/cclifecycle/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (m *MetadataManager) Metadata(channel string, cc string, collections ...str
return nil
}
if len(md) == 0 {
Logger.Info("Chaincode", cc, "isn't defined in channel", channel)
Logger.Warn("Chaincode", cc, "isn't defined in channel", channel)
return nil
}

Expand Down
4 changes: 3 additions & 1 deletion core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedPro
up, err := UnpackProposal(signedProp)
if err != nil {
e.Metrics.ProposalValidationFailed.Add(1)
endorserLogger.Warnw("Failed to unpack proposal", "error", err.Error())
return &pb.ProposalResponse{Response: &pb.Response{Status: 500, Message: err.Error()}}, err
}

Expand All @@ -333,6 +334,7 @@ func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedPro
// 0 -- check and validate
err = e.preProcess(up, channel)
if err != nil {
endorserLogger.Warnw("Failed to preProcess proposal", "error", err.Error())
return &pb.ProposalResponse{Response: &pb.Response{Status: 500, Message: err.Error()}}, err
}

Expand Down Expand Up @@ -531,7 +533,7 @@ func (e *Endorser) buildChaincodeInterest(simResult *ledger.TxSimulationResults)
}
}

endorserLogger.Info("ccInterest", ccInterest)
endorserLogger.Debug("ccInterest", ccInterest)
return ccInterest, nil
}

Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/gateway/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (gs *Server) Endorse(ctx context.Context, request *gp.EndorseRequest) (*gp.
success, message, _, remove := gs.responseStatus(firstResponse, err)

if !success {
logger.Debugw("Endorse call to endorser failed", "channel", request.ChannelId, "txid", request.TransactionId, "endorserAddress", firstEndorser.endpointConfig.address, "endorserMspid", firstEndorser.endpointConfig.mspid, "error", message)
logger.Warnw("Endorse call to endorser failed", "channel", request.ChannelId, "txid", request.TransactionId, "endorserAddress", firstEndorser.endpointConfig.address, "endorserMspid", firstEndorser.endpointConfig.mspid, "error", message)
errDetails = append(errDetails, errorDetail(firstEndorser.endpointConfig, message))
if remove {
gs.registry.removeEndorser(firstEndorser)
Expand Down Expand Up @@ -244,7 +244,7 @@ func (gs *Server) Endorse(ctx context.Context, request *gp.EndorseRequest) (*gp.
responseCh <- &endorserResponse{endorsementSet: endorsements}
e = nil
} else {
logger.Debugw("Endorse call to endorser failed", "channel", request.ChannelId, "txid", request.TransactionId, "numEndorsers", len(endorsers), "endorserAddress", e.endpointConfig.address, "endorserMspid", e.endpointConfig.mspid, "error", message)
logger.Warnw("Endorse call to endorser failed", "channel", request.ChannelId, "txid", request.TransactionId, "numEndorsers", len(endorsers), "endorserAddress", e.endpointConfig.address, "endorserMspid", e.endpointConfig.mspid, "error", message)
responseCh <- &endorserResponse{err: errorDetail(e.endpointConfig, message)}
if remove {
gs.registry.removeEndorser(e)
Expand Down

0 comments on commit a1c13d8

Please sign in to comment.