mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add id to all call invocation logs
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/fnproject/fn/api/common"
|
||||
"github.com/fnproject/fn/api/id"
|
||||
"github.com/fnproject/fn/api/models"
|
||||
"github.com/go-openapi/strfmt"
|
||||
@@ -250,6 +251,10 @@ func (a *agent) GetCall(opts ...CallOpt) (Call, error) {
|
||||
c.ds = a.ds
|
||||
c.mq = a.mq
|
||||
|
||||
ctx, _ := common.LoggerWithFields(c.req.Context(),
|
||||
logrus.Fields{"id": c.ID, "app": c.AppName, "route": c.Path})
|
||||
c.req = c.req.WithContext(ctx)
|
||||
|
||||
return &c, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user