Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com>2022-11-09 11:05:17 +0300
committerArtjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com>2022-11-09 11:05:17 +0300
commitbbaed9ff730649ac34b0c0be1e7d13ac39f75cbb (patch)
tree8fca9bea361a5312201f8ec8039d22bb88611b24 /include
parent8c39dc84f840d3ce17d7fa4517eb36622a6a5d3e (diff)
parent87e29798bfe984bd6ed3e5c1ce36d45f499ffa5f (diff)
.......... [DEV-2134] refactored global variables CONFIG_LOG_TYPE_STR, CONFIG_LOG_TYPE, CONFIG_LOG_FILE and CONFIG_LOG_FILE_SIZE
Diffstat (limited to 'include')
-rw-r--r--include/cfg.h4
-rw-r--r--include/log.h17
-rw-r--r--include/zbxnix.h3
3 files changed, 15 insertions, 9 deletions
diff --git a/include/cfg.h b/include/cfg.h
index 567016329a8..c0bd6216f08 100644
--- a/include/cfg.h
+++ b/include/cfg.h
@@ -45,10 +45,6 @@
#define ZBX_PROXY_HEARTBEAT_FREQUENCY_MAX SEC_PER_HOUR
#define ZBX_PROXY_LASTACCESS_UPDATE_FREQUENCY 5
-extern char *CONFIG_LOG_TYPE_STR;
-extern int CONFIG_LOG_TYPE;
-extern char *CONFIG_LOG_FILE;
-extern int CONFIG_LOG_FILE_SIZE;
extern int CONFIG_TIMEOUT;
struct cfg_line
diff --git a/include/log.h b/include/log.h
index 24d233ac949..d9e509611e7 100644
--- a/include/log.h
+++ b/include/log.h
@@ -43,6 +43,15 @@
#define LOG_ENTRY_INTERVAL_DELAY 60 /* seconds */
extern int zbx_log_level;
+
+typedef struct
+{
+ char *log_file_name;
+ char *log_type_str;
+ int log_type;
+ int log_file_size;
+} zbx_config_log_t;
+
#define ZBX_CHECK_LOG_LEVEL(level) \
((LOG_LEVEL_INFORMATION != (level) && \
((level) > zbx_log_level || LOG_LEVEL_EMPTY == (level))) ? FAIL : SUCCEED)
@@ -61,9 +70,9 @@ extern int zbx_log_level;
# define zabbix_log __zbx_zabbix_log
#endif
-int zabbix_open_log(int type, int level, const char *filename, char **error);
-void __zbx_zabbix_log(int level, const char *fmt, ...) __zbx_attr_format_printf(2, 3);
-void zabbix_close_log(void);
+int zabbix_open_log(const zbx_config_log_t *log_file_cfg, int level, char **error);
+void __zbx_zabbix_log(int level, const char *fmt, ...) __zbx_attr_format_printf(2, 3);
+void zabbix_close_log(void);
#ifndef _WINDOWS
int zabbix_increase_log_level(void);
@@ -83,7 +92,7 @@ int zbx_redirect_stdio(const char *filename);
void zbx_handle_log(void);
int zbx_get_log_type(const char *logtype);
-int zbx_validate_log_parameters(ZBX_TASK_EX *task);
+int zbx_validate_log_parameters(ZBX_TASK_EX *task, const zbx_config_log_t *log_file_cfg);
void zbx_strlog_alloc(int level, char **out, size_t *out_alloc, size_t *out_offset, const char *format,
...) __zbx_attr_format_printf(5, 6);
diff --git a/include/zbxnix.h b/include/zbxnix.h
index eae8b6af05e..e66c4b6415b 100644
--- a/include/zbxnix.h
+++ b/include/zbxnix.h
@@ -46,7 +46,8 @@ int ZBX_EXIT_STATUS(void);
typedef const char* (*zbx_get_pid_file_pathname_f)(void);
int zbx_daemon_start(int allow_root, const char *user, unsigned int flags,
- zbx_get_pid_file_pathname_f get_pid_file_cb, zbx_on_exit_t zbx_on_exit_cb_arg);
+ zbx_get_pid_file_pathname_f get_pid_file_cb, zbx_on_exit_t zbx_on_exit_cb_arg, int config_log_type,
+ const char *config_log_file);
void zbx_daemon_stop(void);
int zbx_sigusr_send(int flags, const char *pid_file_pathname);