]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_syslog: add uuid logging support
authorMathieu Rene <mrene@avgs.ca>
Wed, 6 Jan 2010 17:56:40 +0000 (17:56 +0000)
committerMathieu Rene <mrene@avgs.ca>
Wed, 6 Jan 2010 17:56:40 +0000 (17:56 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16187 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/loggers/mod_syslog/mod_syslog.c

index de87e86064542d02c2dfa4ef25c527c955595a49..11e5ac7b04dafec4f376c54c9f08f8c1bdde08be 100644 (file)
@@ -50,6 +50,7 @@ static struct {
        char *ident;
        char *format;
        int   facility;
+       switch_bool_t log_uuid;
 } globals;
 
 struct _facility_table_entry {
@@ -146,7 +147,11 @@ static switch_status_t mod_syslog_logger(const switch_log_node_t *node, switch_l
 
        /* don't log blank lines */
        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;
@@ -182,6 +187,8 @@ static switch_status_t load_config(void)
                                        if (log_level == SWITCH_LOG_INVALID) {
                                                log_level = SWITCH_LOG_WARNING;
                                        }
+                               } else if (!strcasecmp(var, "uuid")) {
+                                       globals.log_uuid = switch_true(val);
                                }
                        }
                }