[asterisk-dev] [Code Review] 3279: Iterate through logger.conf [general] section

Leif Madsen reviewboard at asterisk.org
Fri Feb 28 07:52:07 CST 2014



> On Feb. 28, 2014, 12:51 p.m., Matt Jordan wrote:
> > I'm not sure I understand the need for this patch.
> > 
> > Setting a configuration option twice - when that option doesn't support being set multiple times - would generally have undefined behaviour. Your patch changes it so that Asterisk reads the last defined value, as opposed to the first. How is that better?

It's better when you want to deploy Asterisk in a DevOps environment. What happens is you define the "default" behavior in the main file that gets deployed. From there you then override that behavior in an included file which is defined and built via DevOps (usually through a template of some sort that contains information for the particular machine you're deploying).

The example is not a good one, because obviously you would never deploy the file in the example provided.

; logger.conf
[general]
queue_log=no

#include logger.conf.d/logger.conf.local


; logger.conf.d/logger.conf.local
[general]
queue_log=yes   ; we've deployed a queue server, so enable queue logging


Primary example of it in use available at https://github.com/kickstandproject/kickstandproject-asterisk/tree/master/templates/etc/asterisk


- Leif


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3279/#review10991
-----------------------------------------------------------


On Feb. 28, 2014, 1:44 a.m., Paul Belanger wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3279/
> -----------------------------------------------------------
> 
> (Updated Feb. 28, 2014, 1:44 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This patch allows you to override the [general] section of logger.conf, making it the same functionality as the [logfiles] sections.
> 
> 
> Diffs
> -----
> 
>   trunk/main/logger.c 409111 
> 
> Diff: https://reviewboard.asterisk.org/r/3279/diff/
> 
> 
> Testing
> -------
> 
> local development. Setup
> 
> [general]
> queue_log = no
> queue_log = yes
> 
> Queue logfiles were created.
> 
> 
> Thanks,
> 
> Paul Belanger
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140228/90445f5d/attachment.html>


More information about the asterisk-dev mailing list