sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
777 stars 368 forks source link

rtpengine commands in loglevel 6 #1844

Closed schoberw closed 1 month ago

schoberw commented 1 month ago

Is your feature request related to a problem? Please describe

The commands from kamailio to rtpengine should be in log level 6. This valuable information only on level "debug" produces most of the time too much information.

Describe the solution you'd like

I added that patch into 11.3.1.15+2nt~mr11.3.1.15 and tested it successfully.

--- daemon/control_ng.c.bak     2024-07-24 15:06:35.956085108 +0200
+++ daemon/control_ng.c 2024-07-24 15:09:31.116381602 +0200
@@ -270,13 +270,13 @@

        ilogs(control, LOG_INFO, "Received command '"STR_FORMAT"' from %s", STR_FMT(&cmd), addr);

-       if (get_log_level(control) >= LOG_DEBUG) {
+       if (get_log_level(control) >= LOG_INFO) {
                log_str = g_string_sized_new(256);
                g_string_append_printf(log_str, "Dump for '"STR_FORMAT"' from %s: %s", STR_FMT(&cmd), addr,
                                rtpe_config.common.log_mark_prefix);
                pretty_print(dict, log_str);
                g_string_append(log_str, rtpe_config.common.log_mark_suffix);
-               ilogs(control, LOG_DEBUG, "%.*s", (int) log_str->len, log_str->str);
+               ilogs(control, LOG_INFO, "%.*s", (int) log_str->len, log_str->str);
                g_string_free(log_str, TRUE);
        }

Describe alternatives you've considered

Setting "debug" from kamailio into the command does not log the first command with all its parameters. Only subsequent ones.

The rtpengine version you checked that didn't have the feature you are asking for

11.3.1.15+2nt~mr11.3.1.15

rfuchs commented 1 month ago

You know you can change the logging level for each logging subsystem? You can just set the control log level to debug and leave everything else as info

schoberw commented 1 month ago

No, I did not know, what "subsystem" it was. But it is well documented, just did not know that I have to look at that.

https://rtpengine.readthedocs.io/en/latest/rtpengine.html#options

–log-level-subsystem=INT

Configures a log level for one of the logging subsystems. A logging subsystem which doesn’t have a log level configured explicitly takes its default value from the log-level setting described above, with the exception of the internals subsystem which by default has all logging disabled.

The full list of logging subsystems can be viewed by pulling up the –help online help. Some (if not all) subsystems are: core, spandsp (messages generated by SpanDSP itself), ffmpeg (messages generated by ffmpeg libraries themselves), transcoding (messages related to RTP/media transcoding), codec (messages related to codec negotiation), rtcp, ice, crypto (messages related to crypto/SRTP/SDES/DTLS negotiation), srtp (messages related to RTP/SRTP en/decryption), internals (disabled by default), http (includes WebSocket), control (messages related to control protocols, including SDP exchanges), dtx.