Skip to content

Commit 5300a0d

Browse files
committed
modify:set log file for configure
1 parent 11b7613 commit 5300a0d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ typedef struct tag_XEngine_ServiceConfig
4646
}st_XTime; //次数*时间=超时
4747
struct
4848
{
49+
XCHAR tszLogFile[MAX_PATH];
4950
int nMaxSize; //最大日志大小
5051
int nMaxCount; //最大日志个数
5152
int nLogLeave; //日志等级

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
161161
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszKeyStr, st_PullWebRtc["tszKeyStr"].asCString());
162162
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszCsrStr, st_PullWebRtc["tszCsrStr"].asCString());
163163
//日志配置
164-
if (st_JsonRoot["XLog"].empty() || (3 != st_JsonRoot["XLog"].size()))
164+
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
165165
{
166166
Config_IsErrorOccur = true;
167167
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XLOG;
@@ -171,6 +171,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
171171
pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt();
172172
pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt();
173173
pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt();
174+
_tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["LogFile"].asCString());
174175
//信息报告
175176
if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size()))
176177
{

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ int main(int argc, char** argv)
150150
bIsRun = true;
151151
LPCXSTR lpszHTTPMime = _X("./XEngine_Config/HttpMime.types");
152152
LPCXSTR lpszHTTPCode = _X("./XEngine_Config/HttpCode.types");
153-
LPCXSTR lpszLogFile = _X("./XEngine_XLog/XEngine_StreamMediaApp.Log");
154153
HELPCOMPONENTS_XLOG_CONFIGURE st_XLogConfig;
155154
THREADPOOL_PARAMENT** ppSt_ListHTTPParam;
156155
THREADPOOL_PARAMENT** ppSt_ListCenterParam;
@@ -164,15 +163,14 @@ int main(int argc, char** argv)
164163

165164
//pSt_VFile = _xtfopen("./1.ts", "wb");
166165
//pSt_AFile = _xtfopen("./1.h264", "wb");
167-
168-
st_XLogConfig.XLog_MaxBackupFile = st_ServiceConfig.st_XLog.nMaxCount;
169-
st_XLogConfig.XLog_MaxSize = st_ServiceConfig.st_XLog.nMaxSize;
170-
_tcsxcpy(st_XLogConfig.tszFileName, lpszLogFile);
171166
//初始化参数
172167
if (!XEngine_Configure_Parament(argc, argv))
173168
{
174169
return -1;
175170
}
171+
st_XLogConfig.XLog_MaxBackupFile = st_ServiceConfig.st_XLog.nMaxCount;
172+
st_XLogConfig.XLog_MaxSize = st_ServiceConfig.st_XLog.nMaxSize;
173+
_tcsxcpy(st_XLogConfig.tszFileName, st_ServiceConfig.st_XLog.tszLogFile);
176174
//判断是否以守护进程启动
177175
if (st_ServiceConfig.bDeamon)
178176
{

0 commit comments

Comments
 (0)