diff --git a/conf/janus.eventhandler.gelfevh.jcfg.sample b/conf/janus.eventhandler.gelfevh.jcfg.sample index 6e470f2698..aea9030317 100644 --- a/conf/janus.eventhandler.gelfevh.jcfg.sample +++ b/conf/janus.eventhandler.gelfevh.jcfg.sample @@ -1,8 +1,8 @@ -# This configures the gelf event handler. Appending necessary headers -# and sending messages via TCP or UDP (maybe quic soon :D) +# This configures the GELF event handler. Appending necessary headers +# and sending messages via TCP or UDP general: { - enabled = false # By default the module is not enabled + enabled = false # By default the module is not enabled events = "all" # Comma separated list of the events mask you're interested # in. Valid values are none, sessions, handles, jsep, webrtc, @@ -11,11 +11,11 @@ general: { backend = "your.gralog.server" port = "12201" - protocol = "tcp" # tcp or udp transport type - max_message_len = 1024 # Note that we add 12 bytes of headers + standard UDP headers (8 bytes) - # when calculating packet size based on MTU + protocol = "tcp" # tcp or udp transport type + max_message_len = 1024 # Note that we add 12 bytes of headers + standard UDP headers (8 bytes) + # when calculating packet size based on MTU - #compress = true # Optionally, only for UDP transport, JSON messages can be compressed using zlib - #compression = 9 # In case, you can specify the compression factor, where 1 is + #compress = true # Optionally, only for UDP transport, JSON messages can be compressed using zlib + #compression = 9 # In case, you can specify the compression factor, where 1 is # the fastest (low compression), and 9 gives the best compression } diff --git a/events/janus_gelfevh.c b/events/janus_gelfevh.c index 2271db2a5c..45863de0fa 100644 --- a/events/janus_gelfevh.c +++ b/events/janus_gelfevh.c @@ -3,10 +3,12 @@ * \copyright GNU General Public License v3 * \brief Janus GelfEventHandler plugin * \details This is a GELF event handler plugin for Janus, which is supposed - * to send json events to GELF (Graylog logger). Necessary headers are prepended. + * to send json events to GELF + * (Graylog logger https://docs.graylog.org/en/3.2/pages/gelf.html). + * Necessary headers are prepended. * For sending, you can use TCP which is not recommended in case there will be * a lot of messages. There is also UDP support, but you need to limit the payload - * size with max_message_len + remember to leave space for 12 bytes for special + * size with max_message_len + remember to leave room for 12 bytes for special * headers. UDP messages will be chunked automatically. * There is also compression available for UDP protocol, to save network bandwith * while using a bit more CPU. This is not available for TCP due to GELF limitations @@ -157,8 +159,8 @@ static int janus_gelfevh_connect(void) { struct sockaddr_in servaddr; if(getaddrinfo(backend, NULL, NULL, &res) != 0 || - janus_network_address_from_sockaddr(res->ai_addr, &addr) != 0 || - janus_network_address_to_string_buffer(&addr, &addr_buf) != 0) { + janus_network_address_from_sockaddr(res->ai_addr, &addr) != 0 || + janus_network_address_to_string_buffer(&addr, &addr_buf) != 0) { if(res) freeaddrinfo(res); JANUS_LOG(LOG_ERR, "Could not resolve address (%s)...\n", backend);