[asterisk-users] Logging different verbosity levels

asterisk at phreaknet.org asterisk at phreaknet.org
Wed May 25 09:54:43 CDT 2022


On 5/25/2022 10:41 AM, Antony Stone wrote:
> On Wednesday 25 May 2022 at 15:27:38, asterisk at phreaknet.org wrote:
>
>> On 5/25/2022 8:11 AM, Antony Stone wrote:
>>> On Tuesday 24 May 2022 at 01:12:46, Kevin Harwell wrote:
>>>> So this turned out more complicated than I originally thought!
>>> Wow, thank you very much for:
>>>
>>> a) such a comprehensive answer
>>>
>>> b) confirming my findings
>>>
>>> c) most of all, working out why and how all this stuff works (or,
>>> perhaps, doesn't).
>>>
>>> I wonder that nobody has discovered this before - do people not want
>>> selective logging levels in their dialplans?
>> If I want to log something from the dialplan, I generally send it to a
>> custom log level, as opposed to one of the built in ones.
> How are you doing this?

See the custom_levels option in the sample logger.conf[1].
You'll need a version of Asterisk from the last ~7 months or so, I think.
>> That way, it's not combined with a bunch of other stuff from Asterisk itself
>> that I generally don't want. This also allows filtering on specific custom log
>> levels. Verbose gets used for so much that if something got logged there
>> it would just get lost.
> Indeed - that was precisely my reasoning for wanting to use the different 
> Verbose(N,message) levels and corresponding log files - so that I could keep 
> specific things separate from each other.

It does sound like using custom levels might be better than your use case.
You can also set up custom log files to log only the log levels you want to create the different "views" you want. 

[1] https://github.com/asterisk/asterisk/blob/master/configs/samples/logger.conf.sample



More information about the asterisk-users mailing list