From a4f5dd9d89d7e66256f93416ab8fa53853e0ccb3 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 11 May 2022 12:13:17 +0800 Subject: [PATCH] add log --- go.sum | 2 -- internal/msg_gateway/gate/logic.go | 2 +- internal/msg_transfer/logic/history_msg_handler.go | 4 ++-- internal/rpc/group/group.go | 1 + pkg/common/config/config.go | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/go.sum b/go.sum index f08695e8f..8777de457 100644 --- a/go.sum +++ b/go.sum @@ -476,8 +476,6 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 3d65af106..51955f0fe 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -60,7 +60,7 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { ws.pullMsgBySeqListReq(conn, &m) default: } - log.NewInfo("", "goroutine num is ", runtime.NumGoroutine()) + log.NewInfo(m.OperationID, "goroutine num is ", runtime.NumGoroutine()) } func (ws *WServer) getSeqReq(conn *UserConn, m *Req) { log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier, m.Data) diff --git a/internal/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go index 424edd4e2..27d84d673 100644 --- a/internal/msg_transfer/logic/history_msg_handler.go +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -136,10 +136,10 @@ func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { log.Error(rpcPushMsg.OperationID, "rpc send failed", rpcPushMsg.OperationID, "push data", rpcPushMsg.String(), "err", err.Error()) pid, offset, err := producer.SendMessage(&mqPushMsg) if err != nil { - log.Error("kafka send failed", mqPushMsg.OperationID, "send data", mqPushMsg.String(), "pid", pid, "offset", offset, "err", err.Error()) + log.Error(message.OperationID, "kafka send failed", mqPushMsg.OperationID, "send data", mqPushMsg.String(), "pid", pid, "offset", offset, "err", err.Error()) } } else { - log.Info("rpc send success", rpcPushMsg.OperationID, "push data", rpcPushMsg.String()) + log.Info(message.OperationID, "rpc send success", rpcPushMsg.OperationID, "push data", rpcPushMsg.String()) } } diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 2b461896a..df60e7f2a 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -76,6 +76,7 @@ func (s *groupServer) Run() { log.NewError("", "RegisterEtcd failed ", err.Error()) return } + log.Info("", "RegisterEtcd ", s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName) err = srv.Serve(listener) if err != nil { log.NewError("", "Serve failed ", err.Error()) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 478d1ba6d..9d2ca8e55 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -85,7 +85,7 @@ type config struct { DBMaxLifeTime int `yaml:"dbMaxLifeTime"` } Mongo struct { - DBUri string `yaml:"dbUri"` // 当dbUri值不为空则直接使用该值 + DBUri string `yaml:"dbUri"` DBAddress []string `yaml:"dbAddress"` DBDirect bool `yaml:"dbDirect"` DBTimeout int `yaml:"dbTimeout"`