API: Fixes request logging middleware to include userId, orgId, uname (#47183)

Fixes #47006
This commit is contained in:
Marcus Efraimsson
2022-04-01 13:24:39 +02:00
committed by GitHub
parent 9d3b701797
commit 16db1ad46d
4 changed files with 24 additions and 4 deletions

View File

@@ -137,7 +137,7 @@ func (h *ContextHandler) Middleware(mContext *web.Context) {
case h.initContextWithAnonymousUser(reqContext):
}
reqContext.Logger = log.New("context", "userId", reqContext.UserId, "orgId", reqContext.OrgId, "uname", reqContext.Login)
reqContext.Logger = reqContext.Logger.New("userId", reqContext.UserId, "orgId", reqContext.OrgId, "uname", reqContext.Login)
span.AddEvents(
[]string{"uname", "orgId", "userId"},
[]tracing.EventValue{