Skip to content

Commit

Permalink
Extra info in log message (#2982)
Browse files Browse the repository at this point in the history
Add the transaction ID and the orderer endpoint address to the log message before sending the transaction to the orderer.

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
  • Loading branch information
andrew-coleman committed Oct 14, 2021
1 parent 755ba79 commit 2ede756
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/gateway/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ func (gs *Server) Submit(ctx context.Context, request *gp.SubmitRequest) (*gp.Su
var errDetails []proto.Message
for _, index := range rand.Perm(len(orderers)) {
orderer := orderers[index]
logger.Infow("Sending transaction to orderer", "TxID", request.TransactionId, "endpoint", orderer.address)
err := gs.broadcast(ctx, orderer, txn)
if err == nil {
return &gp.SubmitResponse{}, nil
Expand All @@ -299,7 +300,6 @@ func (gs *Server) broadcast(ctx context.Context, orderer *orderer, txn *common.E
if err != nil {
return fmt.Errorf("failed to create BroadcastClient: %w", err)
}
logger.Info("Submitting txn to orderer")
if err := broadcast.Send(txn); err != nil {
return fmt.Errorf("failed to send transaction to orderer: %w", err)
}
Expand Down

0 comments on commit 2ede756

Please sign in to comment.