Allow env variables to override config.
(This ties it into wrap.c.)
@@ -25,6 +25,7 @@ reinitLogDescriptor()
{
char* path = cfgPath(CFG_FILE_NAME);
config_t* cfg = cfgRead(path);
+ cfgProcessEnvironment(cfg);
logDestroy(&g_log);
g_log = initLog(cfg);
@@ -38,6 +39,7 @@ reinitMetricDescriptor()
{
char* path = cfgPath(CFG_FILE_NAME);
config_t* cfg = cfgRead(path);
+ cfgProcessEnvironment(cfg);
outDestroy(&g_out);
g_out = initOut(cfg, NULL);
@@ -1421,6 +1423,7 @@ init(void)
{
char* path = cfgPath(CFG_FILE_NAME);
config_t* cfg = cfgRead(path);
+ cfgProcessEnvironment(cfg);
g_thread.interval = cfgOutPeriod(cfg);
g_thread.startTime = time(NULL) + g_thread.interval;
