]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Lower log level of limit increases and releases
authorTravis Cross <tc@traviscross.com>
Thu, 28 Aug 2014 01:40:36 +0000 (01:40 +0000)
committerTravis Cross <tc@traviscross.com>
Thu, 28 Aug 2014 01:40:36 +0000 (01:40 +0000)
In some configurations where many limits are used, the limit increases
and releases were generating a lot of noise and making it harder to
see when limits were exceeded, which was at the same log level.

src/mod/applications/mod_db/mod_db.c
src/mod/applications/mod_hash/mod_hash.c
src/switch_limit.c

index 58a5a25616db5f070b0b56800b2926eb20a9c8b6..d0e9dd8931a0d9ea828c698c845b1e4cc145718f 100644 (file)
@@ -188,9 +188,9 @@ SWITCH_LIMIT_INCR(limit_incr_db)
        got = atoi(gotstr);
 
        if (max < 0) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s_%s is now %d\n", realm, resource, got + 1);
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s_%s is now %d\n", realm, resource, got + 1);
        } else {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s_%s is now %d/%d\n", realm, resource, got + 1, max);
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s_%s is now %d/%d\n", realm, resource, got + 1, max);
        }
 
        if (max >= 0 && got + 1 > max) {
index d151bd7c9d85b86030ec32eacbc7cee382873f50..b24cab6bc7bad26f73c203a5cde59ff04ced5dda 100644 (file)
@@ -197,11 +197,11 @@ SWITCH_LIMIT_INCR(limit_incr_hash)
                switch_core_hash_insert(pvt->hash, hashkey, item);
 
                if (max == -1) {
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s is now %d\n", hashkey, item->total_usage + remote_usage.total_usage);
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s is now %d\n", hashkey, item->total_usage + remote_usage.total_usage);
                } else if (interval == 0) {
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s is now %d/%d\n", hashkey, item->total_usage + remote_usage.total_usage, max);
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s is now %d/%d\n", hashkey, item->total_usage + remote_usage.total_usage, max);
                } else {
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s is now %d/%d for the last %d seconds\n", hashkey,
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s is now %d/%d for the last %d seconds\n", hashkey,
                                                          item->rate_usage, max, interval);
                }
 
@@ -301,7 +301,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
 
                        item = (limit_hash_item_t *) val;
                        item->total_usage--;
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s is now %d\n", (const char *) key, item->total_usage);
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s is now %d\n", (const char *) key, item->total_usage);
 
                        if (item->total_usage == 0 && item->rate_usage == 0) {
                                /* Noone is using this item anymore */
@@ -316,7 +316,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
 
                if ((item = (limit_hash_item_t *) switch_core_hash_find(pvt->hash, hashkey))) {
                        item->total_usage--;
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Usage for %s is now %d\n", (const char *) hashkey, item->total_usage);
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Usage for %s is now %d\n", (const char *) hashkey, item->total_usage);
 
                        switch_core_hash_delete(pvt->hash, hashkey);
 
index e6e421b091a24250a4f2396f648eff9ddeeba64a..e703432252ca7b6c6129cbf5a93243f22ff2a0d4 100644 (file)
@@ -123,7 +123,7 @@ SWITCH_DECLARE(switch_status_t) switch_limit_incr(const char *backend, switch_co
                switch_goto_status(SWITCH_STATUS_GENERR, end);
        }
 
-       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "incr called: %s_%s max:%d, interval:%d\n",
+       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "incr called: %s_%s max:%d, interval:%d\n",
                                          realm, resource, max, interval);
        
        if ((status = limit->incr(session, realm, resource, max, interval)) == SWITCH_STATUS_SUCCESS) {