Skip to content

Commit e874b41

Browse files
committed
added:set log type support
1 parent 127b76a commit e874b41

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"tszLOGFile":"./XEngine_Log/XEngine_MQServiceApp.Log",
2020
"MaxSize":1024000,
2121
"MaxCount":10,
22-
"LogLeave":17
22+
"LogLeave":32,
23+
"LogType":17
2324
},
2425
"XSql":{
2526
"SQLAddr":"10.0.2.6",
@@ -38,7 +39,7 @@
3839
"bDataQueryEnable":true,
3940
"bDataInsertEnable":true,
4041
"bUserQueryEnable":true,
41-
"nTimeLast":3600,
42+
"nTimeLast":60,
4243
"nTimeCount":0
4344
},
4445
"XReport":{

XEngine_Source/MQCore_ConfigModule/Config_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typedef struct
3838
int nMaxSize;
3939
int nMaxCount;
4040
int nLogLeave;
41+
int nLogType;
4142
}st_XLog;
4243
struct
4344
{

XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG
8686
pSt_ServerConfig->st_XMax.nWSThread = st_JsonXMax["nWSThread"].asInt();
8787
pSt_ServerConfig->st_XMax.nMQTTThread = st_JsonXMax["nMQTTThread"].asInt();
8888

89-
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
89+
if (st_JsonRoot["XLog"].empty() || (5 != st_JsonRoot["XLog"].size()))
9090
{
9191
Config_IsErrorOccur = true;
9292
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XLOG;
@@ -96,6 +96,7 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG
9696
pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt();
9797
pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt();
9898
pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt();
99+
pSt_ServerConfig->st_XLog.nLogType = st_JsonXLog["LogType"].asInt();
99100
_tcsxcpy(pSt_ServerConfig->st_XLog.tszLOGFile, st_JsonXLog["tszLOGFile"].asCString());
100101

101102
if (st_JsonRoot["XSql"].empty() || (4 != st_JsonRoot["XSql"].size()))

XEngine_Source/XEngine_MQServiceApp/XEngine_MQServiceApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int main(int argc, char** argv)
147147
st_XLogConfig.XLog_MaxSize = st_ServiceCfg.st_XLog.nMaxSize;
148148
_tcsxcpy(st_XLogConfig.tszFileName, st_ServiceCfg.st_XLog.tszLOGFile);
149149

150-
xhLog = HelpComponents_XLog_Init(HELPCOMPONENTS_XLOG_OUTTYPE_STD | HELPCOMPONENTS_XLOG_OUTTYPE_FILE, &st_XLogConfig);
150+
xhLog = HelpComponents_XLog_Init(st_ServiceCfg.st_XLog.nLogType, &st_XLogConfig);
151151
if (NULL == xhLog)
152152
{
153153
printf("启动服务器失败,启动日志失败,错误:%lX", XLog_GetLastError());

0 commit comments

Comments
 (0)