Skip to content

Commit

Permalink
Merge pull request #126 from hyperledger/log-ctx
Browse files Browse the repository at this point in the history
Do not lose calling context in the logger
  • Loading branch information
nguyer authored Feb 29, 2024
2 parents 04b5589 + 901bd3a commit a54fd73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/ffresty/ffresty.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ func NewWithConfig(ctx context.Context, ffrestyConfig Config) (client *resty.Cli
}
rCtx = context.WithValue(rCtx, retryCtxKey{}, r)
// Create a request logger from the root logger passed into the client
l := log.L(ctx).WithField("breq", r.id)
rCtx = log.WithLogger(rCtx, l)
rCtx = log.WithLogField(rCtx, "breq", r.id)
req.SetContext(rCtx)
}

Expand Down

0 comments on commit a54fd73

Please sign in to comment.