上传官网错误日志补充

This commit is contained in:
liwei1dao 2022-11-21 15:00:00 +08:00
parent 5266b0b6fa
commit 14f4068e3e
2 changed files with 7 additions and 2 deletions

View File

@ -270,14 +270,14 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
if len(serviceTag) == 0 { if len(serviceTag) == 0 {
if err = this.gateway.Service().RpcCall(context.Background(), servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { if err = this.gateway.Service().RpcCall(context.Background(), servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil {
this.gateway.Error("[UserResponse]", this.gateway.Error("[UserResponse]",
log.Fields{"uid": this.uId, "req": req.String(), "err": err.Error()}, log.Fields{"uid": this.uId, "serviceTag": serviceTag, "servicePath": servicePath, "req": req.String(), "err": err.Error()},
) )
return return
} }
} else { //跨集群调用 } else { //跨集群调用
if err = this.gateway.Service().AcrossClusterRpcCall(context.Background(), serviceTag, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { if err = this.gateway.Service().AcrossClusterRpcCall(context.Background(), serviceTag, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil {
this.gateway.Error("[UserResponse]", this.gateway.Error("[UserResponse]",
log.Fields{"uid": this.uId, "req": req.String(), "err": err.Error()}, log.Fields{"uid": this.uId, "serviceTag": serviceTag, "servicePath": servicePath, "req": req.String(), "err": err.Error()},
) )
return return
} }

View File

@ -1,6 +1,8 @@
package gateway package gateway
import ( import (
"errors"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/utils/mapstructure" "go_dreamfactory/lego/utils/mapstructure"
"go_dreamfactory/modules" "go_dreamfactory/modules"
) )
@ -26,5 +28,8 @@ func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
} }
err = mapstructure.Decode(settings, this) err = mapstructure.Decode(settings, this)
} }
if this.Log = log.NewTurnlog(this.Debug, log.Clone("", 4)); this.Log == nil {
err = errors.New("log is nil")
}
return return
} }