提交 a4b094dd authored 作者: Mathieu Rene's avatar Mathieu Rene

mod_syslog: add uuid logging support

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16187 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 42f8ffca
...@@ -50,6 +50,7 @@ static struct { ...@@ -50,6 +50,7 @@ static struct {
char *ident; char *ident;
char *format; char *format;
int facility; int facility;
switch_bool_t log_uuid;
} globals; } globals;
struct _facility_table_entry { struct _facility_table_entry {
...@@ -146,7 +147,11 @@ static switch_status_t mod_syslog_logger(const switch_log_node_t *node, switch_l ...@@ -146,7 +147,11 @@ static switch_status_t mod_syslog_logger(const switch_log_node_t *node, switch_l
/* don't log blank lines */ /* don't log blank lines */
if (!zstr(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) { if (!zstr(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
syslog(syslog_level, "%s", node->data); if (globals.log_uuid && !zstr(node->userdata)) {
syslog(syslog_level, "%s %s", node->userdata, node->data);
} else {
syslog(syslog_level, "%s", node->data);
}
} }
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
...@@ -182,6 +187,8 @@ static switch_status_t load_config(void) ...@@ -182,6 +187,8 @@ static switch_status_t load_config(void)
if (log_level == SWITCH_LOG_INVALID) { if (log_level == SWITCH_LOG_INVALID) {
log_level = SWITCH_LOG_WARNING; log_level = SWITCH_LOG_WARNING;
} }
} else if (!strcasecmp(var, "uuid")) {
globals.log_uuid = switch_true(val);
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论