Merge pull request #13349 from taosdata/fix/ZhiqiangWang/TD-15848-add-log-data-dir-configure
fix(os): add log data dir configure
This commit is contained in:
commit
803ed0e3fd
|
@ -33,8 +33,19 @@ extern "C" {
|
|||
|
||||
#ifdef WINDOWS
|
||||
#define TD_TMP_DIR_PATH "C:\\Windows\\Temp\\"
|
||||
#define TD_CFG_DIR_PATH "C:\\TDengine\\cfg\\"
|
||||
#define TD_DATA_DIR_PATH "C:\\TDengine\\data\\"
|
||||
#define TD_LOG_DIR_PATH "C:\\TDengine\\log\\"
|
||||
#elif defined(_TD_DARWIN_64)
|
||||
#define TD_TMP_DIR_PATH "/tmp/taosd/"
|
||||
#define TD_CFG_DIR_PATH "/usr/local/etc/taos/"
|
||||
#define TD_DATA_DIR_PATH "/usr/local/var/lib/taos/"
|
||||
#define TD_LOG_DIR_PATH "/usr/local/var/log/taos/"
|
||||
#else
|
||||
#define TD_TMP_DIR_PATH "/tmp/"
|
||||
#define TD_CFG_DIR_PATH "/etc/taos/"
|
||||
#define TD_DATA_DIR_PATH "/var/lib/taos/"
|
||||
#define TD_LOG_DIR_PATH "/var/log/taos/"
|
||||
#endif
|
||||
|
||||
typedef struct TdDir *TdDirPtr;
|
||||
|
|
|
@ -368,7 +368,7 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
|
|||
SDiskCfg pDisks = {0};
|
||||
pDisks.level = 0;
|
||||
pDisks.primary = 1;
|
||||
strncpy(pDisks.dir, "/var/lib/taos", TSDB_FILENAME_LEN);
|
||||
strncpy(pDisks.dir, TD_DATA_DIR_PATH, TSDB_FILENAME_LEN);
|
||||
int32_t numOfDisks = 1;
|
||||
pTsdb->pTfs = tfsOpen(&pDisks, numOfDisks);
|
||||
EXPECT_NE(pTsdb->pTfs, nullptr);
|
||||
|
|
|
@ -137,7 +137,7 @@ void ctgTestInitLogFile() {
|
|||
|
||||
tsAsyncLog = 0;
|
||||
qDebugFlag = 159;
|
||||
strcpy(tsLogDir, "/var/log/taos");
|
||||
strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
||||
|
||||
ctgdEnableDebug("api");
|
||||
ctgdEnableDebug("meta");
|
||||
|
|
|
@ -108,7 +108,7 @@ void qwtInitLogFile() {
|
|||
|
||||
tsAsyncLog = 0;
|
||||
qDebugFlag = 159;
|
||||
strcpy(tsLogDir, "/var/log/taos");
|
||||
strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
||||
|
||||
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
|
||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||
|
|
|
@ -60,7 +60,7 @@ void flttInitLogFile() {
|
|||
|
||||
tsAsyncLog = 0;
|
||||
qDebugFlag = 159;
|
||||
strcpy(tsLogDir, "/var/log/taos");
|
||||
strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
||||
|
||||
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
|
||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||
|
|
|
@ -74,7 +74,7 @@ void scltInitLogFile() {
|
|||
|
||||
tsAsyncLog = 0;
|
||||
qDebugFlag = 159;
|
||||
strcpy(tsLogDir, "/var/log/taos");
|
||||
strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
||||
|
||||
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
|
||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||
|
|
|
@ -79,7 +79,7 @@ void schtInitLogFile() {
|
|||
|
||||
tsAsyncLog = 0;
|
||||
qDebugFlag = 159;
|
||||
strcpy(tsLogDir, "/var/log/taos");
|
||||
strcpy(tsLogDir, TD_LOG_DIR_PATH);
|
||||
|
||||
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
|
||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||
|
|
|
@ -70,11 +70,11 @@ void osDefaultInit() {
|
|||
|
||||
#elif defined(_TD_DARWIN_64)
|
||||
if (configDir[0] == 0) {
|
||||
strcpy(configDir, "/tmp/taosd");
|
||||
strcpy(configDir, "/usr/local/etc/taos");
|
||||
}
|
||||
strcpy(tsDataDir, "/usr/local/var/lib/taos");
|
||||
strcpy(tsLogDir, "/usr/local/var/log/taos");
|
||||
strcpy(tsTempDir, "/usr/local/etc/taos");
|
||||
strcpy(tsTempDir, "/tmp/taosd");
|
||||
strcpy(tsOsName, "Darwin");
|
||||
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue