diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 150a11b64..88fad8c0c 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -183,7 +183,7 @@ func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, tok for _, v := range ws.wsUserToConn { count = count + len(v) } - log.WarnByKv("WS Add operation", "", "wsUser added", ws.wsUserToConn, "uid", uid, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + log.WarnByKv("WS Add operation", "", "wsUser added", ws.wsUserToConn, "connection_uid", uid, "connection_platform", constant.PlatformIDToName(platformID), "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) } @@ -206,9 +206,9 @@ func (ws *WServer) delUserConn(conn *UserConn) { for _, v := range ws.wsUserToConn { count = count + len(v) } - log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "uid", uid, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) } else { - log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "uid", uid, "online_user_num", len(ws.wsUserToConn)) + log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn)) } delete(ws.wsConnToUser, conn) @@ -272,7 +272,6 @@ func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { http.Error(w, http.StatusText(status), status) return false } - } func genMapKey(uid string, platformID int32) string { return uid + " " + constant.PlatformIDToName(platformID) diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index 49f800242..910c9b5ab 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -150,6 +150,7 @@ func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) for _, userID := range req.DeleteUserIDList { err := imdb.DeleteUser(userID) if err != nil { + log.NewError(req.OperationID, "delete user error", userID) common.ErrCode = 201 common.ErrMsg = "some uid deleted failed" resp.FailedUserIDList = append(resp.FailedUserIDList, userID)