summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-05-08 15:11:19 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-05-08 15:48:31 -0600
commit944f9435bc9f65fba6ef2975fd3cccdddf978897 (patch)
tree1036fcef6235828863166bde61a385ae0699c00d /configs
parent6b9ed2574bf416d89b1e7f033d4ee9f73abe7761 (diff)
logger: Added logger_queue_limit to the configuration options.
All log messages go to a queue serviced by a single thread which does all the IO. This setting controls how big that queue can get (and therefore how much memory is allocated) before new messages are discarded. The default is 1000. Should something go bezerk and log tons of messages in a tight loop, this will prevent memory escalation. When the limit is reached, a WARNING is logged to that effect and messages are discarded until the queue is empty again. At that time another WARNING will be logged with the count of discarded messages. There's no "low water mark" for this queue because the logger thread empties the entire queue and processes it in 1 batch before going back and waiting on the queue again. Implementing a low water mark would mean additional locking as the thread processes each message and it's not worth it. A "test" was added to test_logger.c but since the outcome is non-deterministic, it's really just a cli command, not a unit test. Change-Id: Ib4520c95e1ca5325dbf584c7989ce391649836d1
Diffstat (limited to 'configs')
-rw-r--r--configs/samples/logger.conf.sample8
1 files changed, 8 insertions, 0 deletions
diff --git a/configs/samples/logger.conf.sample b/configs/samples/logger.conf.sample
index b504467ec..e5f0c551a 100644
--- a/configs/samples/logger.conf.sample
+++ b/configs/samples/logger.conf.sample
@@ -78,6 +78,14 @@
; Directory for log files is configures in asterisk.conf
; option astlogdir
;
+; All log messages go to a queue serviced by a single thread
+; which does all the IO. This setting controls how big that
+; queue can get (and therefore how much memory is allocated)
+; before new messages are discarded.
+; The default is 1000
+;logger_queue_limit = 250
+;
+;
[logfiles]
;
; Format is: