Skip to content

Commit

Permalink
Add a FIXME for the HTTP request IDs not working
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Apr 17, 2023
1 parent aad0030 commit d8ddc47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/soroban-rpc/internal/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ type rpcLogger struct {

func (r *rpcLogger) LogRequest(ctx context.Context, req *jrpc2.Request) {
logger := r.logger.WithFields(log.F{
"subsys": "jsonrpc",
"req": middleware.GetReqID(ctx),
"subsys": "jsonrpc",
// FIXME: the HTTP request context is independent from the JSONRPC context, and thuse the code below doesn't work
// "req": middleware.GetReqID(ctx),
"json_req": req.ID(),
"method": req.Method(),
})
Expand All @@ -91,7 +92,8 @@ func (r *rpcLogger) LogResponse(ctx context.Context, rsp *jrpc2.Response) {
// TODO: Print the elapsed time (there doesn't seem to be a way to it with with jrpc2, since
// LogRequest cannot modify the context)
logger := r.logger.WithFields(log.F{
"subsys": "jsonrpc",
"subsys": "jsonrpc",
// FIXME: the HTTP request context is independent from the JSONRPC context, and thuse the code below doesn't work
"req": middleware.GetReqID(ctx),
"json_req": rsp.ID(),
})
Expand Down

0 comments on commit d8ddc47

Please sign in to comment.