fix: logclient request add service name context

This commit is contained in:
QIU Jian
2023-03-05 02:42:38 +08:00
parent bb5c1b06c2
commit c3f94b60ec
+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.GetServiceName())
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)