Skip to content

Commit

Permalink
fix indexes when printing method name
Browse files Browse the repository at this point in the history
  • Loading branch information
dsegundo2 committed Apr 25, 2022
1 parent 4085370 commit decc32a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xrequestid/requestid.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ func newRequestID() string {
// FullMethod is the full RPC method string, i.e., /package.service/method.
func logRequestWithID(requestData interface{}, requestID, fullMethod string) {
methodPath := strings.Split(fullMethod, "/")
if len(methodPath) > 1 {
if len(methodPath) > 2 {
logrus.WithFields(logrus.Fields{
"Request Data": fmt.Sprintf("%+v", requestData),
"Request ID": requestID,
"Package.Service": methodPath[0],
"Method Name": methodPath[1],
"Package.Service": methodPath[1],
"Method Name": methodPath[2],
}).Infof("Request ID appended to request")
} else {
logrus.WithFields(logrus.Fields{
Expand Down

0 comments on commit decc32a

Please sign in to comment.