Merge pull request #16129 from swordqiu/hotfix/qj-logclient-add-service-name-context

fix: logclient request add service name context
This commit is contained in:
Zexi Li
2023-03-08 11:15:55 +08:00
committed by GitHub
+3 -1
View File
@@ -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)