]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add loglevel param to switch.conf
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 5 Oct 2007 18:59:18 +0000 (18:59 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 5 Oct 2007 18:59:18 +0000 (18:59 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5822 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/switch.conf.xml
src/switch_core.c

index a463dc487a9c811bb39c61c95be870121bf3c0ef..0772630c002b7526bd8f4dac5af45a0b61dec292 100644 (file)
@@ -4,6 +4,8 @@
     <param name="max-sessions" value="1000"/>
     <!--Most channels to create per second -->
     <param name="sessions-per-second" value="30"/>
+    <!--Most channels to create per second -->
+    <param name="loglevel" value="debug"/>
     <!--Try to catch any crashes that can be recoverable (in the context of a call)-->
     <param name="crash-protection" value="false"/>
     <!--RTP port range -->
index 1e6f09575762d8e89c6bcf361d6bd42a1c4fac24..18718c687c7d839075bd90fff5c1e05dd681964f 100644 (file)
@@ -443,6 +443,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_cor
                                        if (switch_true(val)) {
                                                switch_set_flag((&runtime), SCF_CRASH_PROT);
                                        }
+                               } else if (!strcasecmp(var, "loglevel")) {
+                    int level;                                                                                                                                  
+                    if (*val > 47 && *val < 58) {
+                        level = atoi(val);
+                    } else {
+                        level = switch_log_str2level(val);
+                    }
+
+                    switch_core_session_ctl(SCSC_LOGLEVEL, &level);
+                                       
                                } else if (!strcasecmp(var, "sessions-per-second")) {
                                        switch_core_sessions_per_second(atoi(val));
                                } else if (!strcasecmp(var, "max-sessions")) {