diff options
author | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2022-11-02 11:39:22 +0300 |
---|---|---|
committer | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2022-11-02 11:39:22 +0300 |
commit | 81c7f39595754a5d01edfac5017ac8a129737417 (patch) | |
tree | dd76568cef269abd7016479d84380e3a1a3aaae2 /src | |
parent | aff99e9c31c824d2cbe24151e416f6218dd53362 (diff) |
.......... [DEV-2134] added more changes
Diffstat (limited to 'src')
-rw-r--r-- | src/zabbix_agent/zabbix_agentd.c | 5 | ||||
-rw-r--r-- | src/zabbix_js/zabbix_js.c | 2 | ||||
-rw-r--r-- | src/zabbix_proxy/proxy.c | 5 | ||||
-rw-r--r-- | src/zabbix_sender/zabbix_sender.c | 2 | ||||
-rw-r--r-- | src/zabbix_server/server.c | 15 |
5 files changed, 16 insertions, 13 deletions
diff --git a/src/zabbix_agent/zabbix_agentd.c b/src/zabbix_agent/zabbix_agentd.c index 4448ba4fb13..1880fcc035f 100644 --- a/src/zabbix_agent/zabbix_agentd.c +++ b/src/zabbix_agent/zabbix_agentd.c @@ -1099,7 +1099,7 @@ int MAIN_ZABBIX_ENTRY(int flags) exit(EXIT_FAILURE); } #endif - if (SUCCEED != zabbix_open_log(log_file_cfg->config_log_type, CONFIG_LOG_LEVEL, CONFIG_LOG_FILE, &error)) + if (SUCCEED != zabbix_open_log(&log_file_cfg, CONFIG_LOG_LEVEL, &error)) { zbx_error("cannot open log: %s", error); zbx_free(error); @@ -1495,7 +1495,8 @@ int main(int argc, char **argv) #if defined(ZABBIX_SERVICE) service_start(t.flags); #elif defined(ZABBIX_DAEMON) - zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit); + zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit, + log_file_cfg->log_type, log_file_cfg->log_file_name); #endif exit(EXIT_SUCCESS); } diff --git a/src/zabbix_js/zabbix_js.c b/src/zabbix_js/zabbix_js.c index 01b618c6030..4164ef753ba 100644 --- a/src/zabbix_js/zabbix_js.c +++ b/src/zabbix_js/zabbix_js.c @@ -175,7 +175,7 @@ int main(int argc, char **argv) goto clean; } - if (SUCCEED != zabbix_open_log(LOG_TYPE_UNDEFINED, loglevel, NULL, &error)) + if (SUCCEED != zabbix_open_log(&log_file_cfg, loglevel, &error)) { zbx_error("cannot open log: %s", error); goto clean; diff --git a/src/zabbix_proxy/proxy.c b/src/zabbix_proxy/proxy.c index d63643429cf..32c7a38343f 100644 --- a/src/zabbix_proxy/proxy.c +++ b/src/zabbix_proxy/proxy.c @@ -1120,7 +1120,8 @@ int main(int argc, char **argv) exit(SUCCEED == ret ? EXIT_SUCCESS : EXIT_FAILURE); } - return zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit, &log_file_cfg); + return zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit, + log_file_cfg->log_type, log_file_cfg->log_file_name); } static void zbx_check_db(void) @@ -1233,7 +1234,7 @@ int MAIN_ZABBIX_ENTRY(int flags) exit(EXIT_FAILURE); } - if (SUCCEED != zabbix_open_log(log_file_cfg->log_type_str, CONFIG_LOG_LEVEL, CONFIG_LOG_FILE, &error)) + if (SUCCEED != zabbix_open_log(&log_file_cfg, CONFIG_LOG_LEVEL, &error)) { zbx_error("cannot open log:%s", error); zbx_free(error); diff --git a/src/zabbix_sender/zabbix_sender.c b/src/zabbix_sender/zabbix_sender.c index 123e79d1c67..6480c1cda10 100644 --- a/src/zabbix_sender/zabbix_sender.c +++ b/src/zabbix_sender/zabbix_sender.c @@ -1514,7 +1514,7 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } #endif - if (SUCCEED != zabbix_open_log(LOG_TYPE_UNDEFINED, CONFIG_LOG_LEVEL, NULL, &error)) + if (SUCCEED != zabbix_open_log(&log_file_cfg, CONFIG_LOG_LEVEL, &error)) { zbx_error("cannot open log: %s", error); zbx_free(error); diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c index 7467f71d409..e173cff6e9e 100644 --- a/src/zabbix_server/server.c +++ b/src/zabbix_server/server.c @@ -817,11 +817,11 @@ static void zbx_load_config(ZBX_TASK_EX *task) PARM_OPT, 0, 5}, {"PidFile", &CONFIG_PID_FILE, TYPE_STRING, PARM_OPT, 0, 0}, - {"LogType", &CONFIG_LOG_TYPE_STR, TYPE_STRING, + {"LogType", &log_file_cfg.log_type_str, TYPE_STRING, PARM_OPT, 0, 0}, - {"LogFile", &CONFIG_LOG_FILE, TYPE_STRING, + {"LogFile", &log_file_cfg.log_file_name, TYPE_STRING, PARM_OPT, 0, 0}, - {"LogFileSize", &CONFIG_LOG_FILE_SIZE, TYPE_INT, + {"LogFileSize", &log_file_cfg.log_file_size, TYPE_INT, PARM_OPT, 0, 1024}, {"AlertScriptsPath", &CONFIG_ALERT_SCRIPTS_PATH, TYPE_STRING, PARM_OPT, 0, 0}, @@ -969,7 +969,7 @@ static void zbx_load_config(ZBX_TASK_EX *task) parse_cfg_file(config_file, cfg, ZBX_CFG_FILE_REQUIRED, ZBX_CFG_STRICT, ZBX_CFG_EXIT_FAILURE); zbx_set_defaults(); - CONFIG_LOG_TYPE = zbx_get_log_type(CONFIG_LOG_TYPE_STR); + log_file_cfg.log_type = zbx_get_log_type(log_file_cfg.log_type_str); zbx_validate_config(task); #if defined(HAVE_MYSQL) || defined(HAVE_POSTGRESQL) @@ -1178,7 +1178,8 @@ int main(int argc, char **argv) exit(SUCCEED == ret ? EXIT_SUCCESS : EXIT_FAILURE); } - return zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit); + return zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit, + log_file_cfg->log_type, log_file_cfg->log_file_name); } static void zbx_check_db(void) @@ -1549,7 +1550,7 @@ static int server_restart_logger(char **error) if (SUCCEED != zbx_locks_create(error)) return FAIL; - if (SUCCEED != zabbix_open_log(CONFIG_LOG_TYPE, CONFIG_LOG_LEVEL, CONFIG_LOG_FILE, error)) + if (SUCCEED != zabbix_open_log(&log_file_cfg, CONFIG_LOG_LEVEL, error)) return FAIL; return SUCCEED; @@ -1669,7 +1670,7 @@ int MAIN_ZABBIX_ENTRY(int flags) exit(EXIT_FAILURE); } - if (SUCCEED != zabbix_open_log(CONFIG_LOG_TYPE, CONFIG_LOG_LEVEL, CONFIG_LOG_FILE, &error)) + if (SUCCEED != zabbix_open_log(&log_file_cfg, CONFIG_LOG_LEVEL, &error)) { zbx_error("cannot open log: %s", error); zbx_free(error); |