|
@@ -366,7 +366,7 @@ std::pair<unsigned long, ErrMsgStruct> getErrMsgByRemark(std::string srcMsg)
|
|
|
{
|
|
|
const std::string headerStr = "UserError=";
|
|
|
if (srcMsg.find(headerStr) != 0)
|
|
|
- return std::make_pair(0, ErrMsgStruct("", srcMsg, ""));
|
|
|
+ return std::make_pair(0, ErrMsgStruct("RTA42F1", CSimpleString::Format("[RTA42F1]错误映射异常|(%s)", srcMsg.c_str()).GetData(), ""));
|
|
|
|
|
|
unsigned long userCode = std::stoi(srcMsg.substr(headerStr.length()));
|
|
|
std::string userCodeStr = CSimpleString::Format("0x%X", userCode).GetData();
|
|
@@ -825,8 +825,8 @@ std::pair<std::string, std::string> SM2_Encrypt_Manager::EncryptMsg(std::string
|
|
|
unsigned char sign[DEFAULT_KEY_LEN] = "";
|
|
|
int sign_len = DEFAULT_KEY_LEN;
|
|
|
|
|
|
- unsigned char* dstMsg = new unsigned char[msg.length() * 2];
|
|
|
- int dstMsgLen = msg.length() * 2;
|
|
|
+ unsigned char* dstMsg = new unsigned char[msg.length() * 2 + 97];
|
|
|
+ int dstMsgLen = msg.length() * 2 + 97;
|
|
|
std::shared_ptr<void> msgClean((void*)0, [&](void*) {
|
|
|
if (dstMsg)
|
|
|
{
|
|
@@ -838,13 +838,13 @@ std::pair<std::string, std::string> SM2_Encrypt_Manager::EncryptMsg(std::string
|
|
|
|
|
|
if (!SM2SignWithSM3(m_private_key_buf, m_private_key_buf_len, (unsigned char*)msg.c_str(), msg.length(), sign, &sign_len))
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SM2SignWithSM3::err, can not sign msg");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SM2SignWithSM3::err, can not sign msg, sign_len:%d", sign_len);
|
|
|
return std::make_pair("", "");
|
|
|
}
|
|
|
|
|
|
if(!EncWithSM2PubKey((unsigned char*)msg.c_str(), msg.length(), dstMsg, &dstMsgLen, m_opposite_public_key_buf, m_opposite_public_key_buf_len))
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("EncWithSM2PubKey::err, can not encrypt msg");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("EncWithSM2PubKey::err, can not encrypt msg, m_opposite_public_key_buf_len: %d", m_opposite_public_key_buf_len);
|
|
|
return std::make_pair("", "");
|
|
|
}
|
|
|
return std::make_pair(binToHex(sign, sign_len), binToHex(dstMsg, dstMsgLen));
|
|
@@ -953,23 +953,26 @@ LogManager& LogManager::getInstance() {
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketBuild(int64_t hdl, const std::string& url, const std::string& isSecurity) {
|
|
|
+ const char* type = "ws_build";
|
|
|
Json::Value log;
|
|
|
- log["hdl"] = hdl;
|
|
|
- log["78173721_logType"] = "ws_build";
|
|
|
+ log["hdl"] = Json::Int64(hdl);
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["url"] = url;
|
|
|
detail["isSecurity"] = isSecurity;
|
|
|
-
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
-void LogManager::writeLog(const Json::Value& log) {
|
|
|
+void LogManager::writeLog(LOG_LEVEL_E level, const Json::Value& log) {
|
|
|
Json::FastWriter writer;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(writer.write(log).c_str());
|
|
|
+ DbgWithLink(level, LOG_TYPE_SYSTEM)(writer.write(log).c_str());
|
|
|
}
|
|
|
|
|
|
std::string LogManager::getCurrentTimestamp() {
|
|
@@ -1014,9 +1017,11 @@ void LogManager::logWebSocketBeginSession(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "ws_beginSession";
|
|
|
Json::Value log;
|
|
|
- log["hdl"] = hdl;
|
|
|
- log["78173721_logType"] = "ws_beginSession";
|
|
|
+ log["hdl"] = Json::Int64(hdl);
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = web_transID;
|
|
@@ -1033,18 +1038,40 @@ void LogManager::logWebSocketBeginSession(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketClose(int64_t hdl) {
|
|
|
+ const char* type = "ws_close";
|
|
|
Json::Value log;
|
|
|
- log["hdl"] = hdl;
|
|
|
- log["78173721_logType"] = "ws_close";
|
|
|
+ log["hdl"] = Json::Int64(hdl);
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
- writeLog(log);
|
|
|
+
|
|
|
+ Json::Value root(Json::objectValue);
|
|
|
+
|
|
|
+ if (m_logTotal.find(hdl) != m_logTotal.end())
|
|
|
+ {
|
|
|
+ // 遍历 map
|
|
|
+ for (const auto& pair : m_logTotal[hdl]) {
|
|
|
+ std::string key = pair.first;
|
|
|
+ const LogInfo& logInfo = pair.second;
|
|
|
+
|
|
|
+ root[key] = logInfo.num;
|
|
|
+ }
|
|
|
+ log["dealed"] = root;
|
|
|
+ m_logTotal.erase(hdl);
|
|
|
+ }
|
|
|
+
|
|
|
+ writeLog(LOG_LEVEL_INFO, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketInfo(int64_t hdl,
|
|
@@ -1057,9 +1084,11 @@ void LogManager::logWebSocketInfo(int64_t hdl,
|
|
|
int retDetail,
|
|
|
const std::string& reason,
|
|
|
const std::string& payload) {
|
|
|
+ const char* type = "ws_info";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_info";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1076,9 +1105,11 @@ void LogManager::logWebSocketInfo(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketRegister(int64_t hdl,
|
|
@@ -1091,9 +1122,11 @@ void LogManager::logWebSocketRegister(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "ws_register";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_register";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1110,9 +1143,11 @@ void LogManager::logWebSocketRegister(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketRequest(int64_t hdl,
|
|
@@ -1126,9 +1161,11 @@ void LogManager::logWebSocketRequest(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "ws_request";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_request";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1146,9 +1183,11 @@ void LogManager::logWebSocketRequest(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketSetVar(int64_t hdl,
|
|
@@ -1161,9 +1200,11 @@ void LogManager::logWebSocketSetVar(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "ws_setvar";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_setvar";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1180,9 +1221,11 @@ void LogManager::logWebSocketSetVar(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketGetVar(int64_t hdl,
|
|
@@ -1194,9 +1237,11 @@ void LogManager::logWebSocketGetVar(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "ws_getvar";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_getvar";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1212,10 +1257,11 @@ void LogManager::logWebSocketGetVar(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
-
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWebSocketBroadcast(int64_t hdl,
|
|
@@ -1225,9 +1271,11 @@ void LogManager::logWebSocketBroadcast(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "ws_broadcast";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_broadcast";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["entity"] = entity;
|
|
@@ -1241,10 +1289,11 @@ void LogManager::logWebSocketBroadcast(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
-
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logVtmEndSession(int64_t hdl,
|
|
@@ -1255,9 +1304,11 @@ void LogManager::logVtmEndSession(int64_t hdl,
|
|
|
const std::string& payload,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "vtm_endsession";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "vtm_endsession";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["entity"] = entity;
|
|
@@ -1272,10 +1323,11 @@ void LogManager::logVtmEndSession(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
-
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logVtmRequestAck(int64_t hdl,
|
|
@@ -1290,9 +1342,11 @@ void LogManager::logVtmRequestAck(int64_t hdl,
|
|
|
const std::string& srcByte,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "vtm_requestAck";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "vtm_requestAck";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1311,10 +1365,11 @@ void LogManager::logVtmRequestAck(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
-
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logVtmEvent(int64_t hdl,
|
|
@@ -1328,9 +1383,11 @@ void LogManager::logVtmEvent(int64_t hdl,
|
|
|
const std::string& srcByte,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "vtm_event";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "vtm_event";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["inner_transID"] = Json::Int64(inner_transID);
|
|
@@ -1357,10 +1414,11 @@ void LogManager::logVtmEvent(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
-
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logVtmSessionAck(int64_t hdl,
|
|
@@ -1374,9 +1432,11 @@ void LogManager::logVtmSessionAck(int64_t hdl,
|
|
|
const std::string& srcByte,
|
|
|
int retDetail,
|
|
|
const std::string& reason) {
|
|
|
+ const char* type = "vtm_sessionAck";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "vtm_sessionAck";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["web_transID"] = Json::Int64(web_transID);
|
|
@@ -1394,10 +1454,11 @@ void LogManager::logVtmSessionAck(int64_t hdl,
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
-
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWsLogEvent(
|
|
@@ -1411,9 +1472,11 @@ void LogManager::logWsLogEvent(
|
|
|
int retDetail,
|
|
|
const std::string& reason
|
|
|
) {
|
|
|
+ const char* type = "ws_logEvent";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_logEvent";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["securityLevel"] = securityLevel;
|
|
@@ -1430,9 +1493,11 @@ void LogManager::logWsLogEvent(
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logWsLogWarn(
|
|
@@ -1446,9 +1511,11 @@ void LogManager::logWsLogWarn(
|
|
|
int retDetail,
|
|
|
const std::string& reason
|
|
|
) {
|
|
|
+ const char* type = "ws_logWarn";
|
|
|
Json::Value log;
|
|
|
log["hdl"] = Json::Int64(hdl);
|
|
|
- log["78173721_logType"] = "ws_logWarn";
|
|
|
+ log["78173721_logType"] = type;
|
|
|
+ m_logTotal[hdl][type].num += 1;
|
|
|
|
|
|
Json::Value detail;
|
|
|
detail["securityLevel"] = securityLevel;
|
|
@@ -1466,9 +1533,11 @@ void LogManager::logWsLogWarn(
|
|
|
|
|
|
log["detail"] = detail;
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
+ if (ConfigManager::getInstance().m_ws_infoArr.find(hdl) != ConfigManager::getInstance().m_ws_infoArr.end())//add websocket label
|
|
|
+ log["name"] = ConfigManager::getInstance().m_ws_infoArr[hdl].name;
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_DEBUG, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logEntityOnLog(
|
|
@@ -1496,7 +1565,7 @@ void LogManager::logEntityOnLog(
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_INFO, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logEntityBegin(int no_startup) {
|
|
@@ -1510,7 +1579,7 @@ void LogManager::logEntityBegin(int no_startup) {
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_INFO, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logEntityOpenPage(
|
|
@@ -1536,7 +1605,7 @@ void LogManager::logEntityOpenPage(
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_INFO, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logEntityStageChange(
|
|
@@ -1560,7 +1629,8 @@ void LogManager::logEntityStageChange(
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
|
|
|
- writeLog(log);
|
|
|
+
|
|
|
+ writeLog(LOG_LEVEL_INFO, log);
|
|
|
}
|
|
|
|
|
|
void LogManager::logEntityStatus(
|
|
@@ -1586,5 +1656,5 @@ void LogManager::logEntityStatus(
|
|
|
log["threadId"] = Json::Int64(GetCurrentThreadId());
|
|
|
log["timestamp"] = getCurrentTimestamp();
|
|
|
|
|
|
- writeLog(log);
|
|
|
+ writeLog(LOG_LEVEL_INFO, log);
|
|
|
}
|