Add aaa-12 解决logging host del删除不掉的问题

RCA:
SOL:
修改人:liangxia
检视人:
This commit is contained in:
liangxia 2019-09-04 18:07:32 +08:00
parent c443bd5e68
commit 4588ec1a74
2 changed files with 8 additions and 8 deletions

View File

@ -145,8 +145,8 @@ ret_code log_remote_level_config_getall(uint source,
return ret;
}
/* *.=emerg;*.=alert;*.=crit;*.=err;*.=warn;*.=notice;*.=info @1.1.1.1:514:RFC3164fmt
* *.=emerg;*.=alert;*.=crit;*.=err;*.=warn;*.=notice;*.=info @@1.1.1.2:514:RFC5424fmt */
/* *.=emerg;*.=alert;*.=crit;*.=err;*.=warn;*.=notice;*.=info @1.1.1.1:514;RFC3164fmt
* *.=emerg;*.=alert;*.=crit;*.=err;*.=warn;*.=notice;*.=info @@1.1.1.2:514;RFC5424fmt */
static ret_code cm_log_prase_host_from_str(char *const input_str, log_remote_host_x_t *ret_host)
{
char *pos = NULL;
@ -233,7 +233,7 @@ static ret_code cm_log_prase_host_from_str(char *const input_str, log_remote_hos
/* 提取端口 */
pos2 ++;
pos = pos2;
pos2 = strstr(pos, ":");
pos2 = strstr(pos, ";");
if (pos2 == NULL)
{
goto END;

View File

@ -216,9 +216,9 @@ static int add_remote_host(const log_remote_host_t *conf)
};
char redirect[MAX_LINE_SZ];
if (snprintf(redirect, sizeof(redirect), "%s@%s:%u:%s",
if (snprintf(redirect, sizeof(redirect), "%s@%s:%u;%s",
prefix, conf->host, conf->port, rfc_tbl[conf->rfc].fmt) < 0) {
ULOG_ERR(g_log, "Setting remote redirect[%s:%u:%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
ULOG_ERR(g_log, "Setting remote redirect[%s:%u;%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
return -1;
}
@ -230,7 +230,7 @@ static int add_remote_host(const log_remote_host_t *conf)
if (log_conf(level, LOG_CONF_PATH, LOG_CONF_REMOTE_FILE_NAME, NULL,
add_remote_conf_content, (void *)redirect) != 0) {
ULOG_ERR(g_log, "Adding remote server[%s:%u:%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
ULOG_ERR(g_log, "Adding remote server[%s:%u;%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
return -1;
}
@ -249,7 +249,7 @@ static int del_remote_host(const log_remote_host_t *conf)
char redirect[MAX_LINE_SZ];
if (snprintf(redirect, sizeof(redirect), "%s@%s:%u;%s",
prefix, conf->host, conf->port, rfc_tbl[conf->rfc].fmt) < 0) {
ULOG_ERR(g_log, "Setting remote redirect[%s:%u:%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
ULOG_ERR(g_log, "Setting remote redirect[%s:%u;%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
return ret;
}
@ -261,7 +261,7 @@ static int del_remote_host(const log_remote_host_t *conf)
ret = log_conf(level, LOG_CONF_PATH, LOG_CONF_REMOTE_FILE_NAME, NULL,
del_remote_conf_content, (void *)redirect);
if (ret != 0) {
ULOG_ERR(g_log, "Adding remote server[%s:%u:%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
ULOG_ERR(g_log, "Adding remote server[%s:%u;%s] is faulure", conf->host, conf->port, rfc_tbl[conf->rfc].fmt);
return ret;
}