]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11693 [mod_graylog2] add support for switch_channel_set_log_tag()
authorChris Rienzo <chris@signalwire.com>
Sat, 9 Mar 2019 15:18:48 +0000 (15:18 +0000)
committerChris Rienzo <chris@rienzo.com>
Sat, 9 Mar 2019 20:21:57 +0000 (15:21 -0500)
src/mod/loggers/mod_graylog2/mod_graylog2.c

index fef005f56bdcff261c9a2ba57d8443d23011aca7..f5ee0582104a0b25c5cce2f7e82e1d97b5557fae 100644 (file)
@@ -126,8 +126,13 @@ static char *to_gelf(const switch_log_node_t *node, switch_log_level_t log_level
                full_message++;
        }
 
+       /* get fields from log tags */
+       if (node->tags) {
+               switch_event_dup(&log_fields, node->tags);
+       }
+
        /* get fields from channel data, if configured */
-       if (!zstr(node->userdata) && (session = switch_core_session_locate(node->userdata))) {
+       if (!zstr(node->userdata) && globals.session_fields->headers && (session = switch_core_session_locate(node->userdata))) {
                switch_channel_t *channel = switch_core_session_get_channel(session);
                switch_event_header_t *hp;
                /* session_fields name mapped to variable name */