From d03d9893a9a47aab0c84363685761f8424b5c829 Mon Sep 17 00:00:00 2001 From: QIU Jian Date: Sun, 5 Mar 2023 02:19:23 +0800 Subject: [PATCH] fix: logclient request add service name context --- pkg/util/logclient/logclient.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/util/logclient/logclient.go b/pkg/util/logclient/logclient.go index e37a892435..90fcd85dc3 100644 --- a/pkg/util/logclient/logclient.go +++ b/pkg/util/logclient/logclient.go @@ -241,7 +241,9 @@ type logTask struct { } func (t *logTask) Run() { - s := DefaultSessionGenerator(context.Background(), t.userCred, "") + ctx := context.Background() + ctx = context.WithValue(ctx, appctx.APP_CONTEXT_KEY_APPNAME, consts.GetServiceType()) + s := DefaultSessionGenerator(ctx, t.userCred, "") _, err := t.api.Create(s, t.logentry) if err != nil { log.Errorf("create action log %s failed %s", t.logentry, err)