<div dir="ltr">So this turned out more complicated than I originally thought!<br><br>My expectation:<br><br>Verbosity gets logged using an "at least" check against the current system's verbose level, which if passed subsequently gets checked against the logging channel's verbose level. Thus only verbose messages with a level less than or equal to the system's level AND the channel's level would be logged to that channel. For example given a system verbose level of 3, and your setup then the following should occur:<br><br>same => n,Verbose(0,Test message verbosity 0) ; gets logged to logtest.verbose.3, logtest.verbose.2, logtest.verbose.1, and logtest.verbose.0<br>same => n,Verbose(1,Test message verbosity 1) ; gets logged to logtest.verbose.3, logtest.verbose.2, and logtest.verbose.1<br>same => n,Verbose(2,Test message verbosity 2) ; gets logged to logtest.verbose.3 and logtest.verbose.2<br>same => n,Verbose(3,Test message verbosity 3) ; gets logged to logtest.verbose.3<br>same => n,Verbose(4,Test message verbosity 4) ; nothing logged<br>same => n,Verbose(5,Test message verbosity 5) ; nothing logged<br>same => n,Verbose(6,Test message verbosity 6) ; nothing logged<br>same => n,Verbose(7,Test message verbosity 7) ; nothing logged<br>same => n,Verbose(8,Test message verbosity 8) ; nothing logged<br>same => n,Verbose(9,Test message verbosity 9) ; nothing logged<br><br>Reality:<br><br>What you saw in your output. As to why? Well it's a bit of a mess and it's been that way for a while it seems. To start the app_verbose application gets capped at verbose level 4. Meaning the following:<br><br>same => n,Verbose(7,Test message verbosity 7)<br><br>Essentially gets changed to:<br><br>same => n,Verbose(4,Test message verbosity 7)<br><br>Next, Asterisk sets the global verbose logging level according to the following order with each level potentially overriding if greater than the preceding:<br><br>1) core verbose level (set in asterisk.conf)<br>2) console level (set via system CLI, or asterisk CLI)<br>3) channel log level (set in logger.conf, e.g. verbose(9))<br><br>This means in asterisk.conf if you set verbose=2, and then on the CLI set it to 3, and then for any channel in logger.conf specify verbose(9) then the final level will be 9! The levels too are tracked via different variables so given the preceding example the following will be output:<br><br>*CLI> core show settings<br>...<br>Root console verbosity:      2<br>...<br><br>Despite the actual level being 9.<br><br>Lastly, when the logger goes to output the actual log message to a channel it does indeed first check if the channel's verbosity level is greater than some "level" variable. But guess what? This variable is always equal to 0. Thus as long as a channel's level is > 0 it always passes and the message is output.<br><br>So you can see in your setup the final system level is indeed 9, and all app_verbose messages being output are forced to 4 or less. Since the system level is 9, and the channel's verbosity level is greater than zero then all messages are output to all files.<br><br>Hope that makes sense!<br><br>Given all that, in my opinion there seems to be at least one or more bugs with regards to verbose logging. Please file an issue at <a href="https://issues.asterisk.org/">https://issues.asterisk.org/</a>. Feel free to copy/paste what's here as part of the issue description.<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 23, 2022 at 3:29 AM Antony Stone <<a href="mailto:Antony.Stone@asterisk.open.source.it">Antony.Stone@asterisk.open.source.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi.<br>
<br>
Does no-one else know either?  I thought this was a simple question, and it <br>
was just me being unable to find the appropriate documentation to explain how <br>
these logging levels work.<br>
<br>
Please, can anyone help?<br>
<br>
On Friday 20 May 2022 at 15:33:45, Antony Stone wrote:<br>
<br>
> Hi.<br>
> <br>
> I'm trying to use different logging verbosity levels to get dialplan output<br>
> into different log files, and there's clearly something I haven't<br>
> understood about how Asterisk does this...<br>
> <br>
> <br>
> I have the following in /etc/asterisk/logger.conf:<br>
> <br>
> [logfiles]<br>
> logtest.verbose.0 => verbose(0)<br>
> logtest.verbose.1 => verbose(1)<br>
> logtest.verbose.2 => verbose(2)<br>
> logtest.verbose.3 => verbose(3)<br>
> logtest.verbose.4 => verbose(4)<br>
> logtest.verbose.5 => verbose(5)<br>
> logtest.verbose.6 => verbose(6)<br>
> logtest.verbose.7 => verbose(7)<br>
> logtest.verbose.8 => verbose(8)<br>
> logtest.verbose.9 => verbose(9)<br>
> <br>
> I then put the following at a particular point in my dialplan:<br>
> <br>
> same => n,Verbose(0,Test message verbosity 0)<br>
> same => n,Verbose(1,Test message verbosity 1)<br>
> same => n,Verbose(2,Test message verbosity 2)<br>
> same => n,Verbose(3,Test message verbosity 3)<br>
> same => n,Verbose(4,Test message verbosity 4)<br>
> same => n,Verbose(5,Test message verbosity 5)<br>
> same => n,Verbose(6,Test message verbosity 6)<br>
> same => n,Verbose(7,Test message verbosity 7)<br>
> same => n,Verbose(8,Test message verbosity 8)<br>
> same => n,Verbose(9,Test message verbosity 9)<br>
> <br>
> I was expecting to get each message output into the respective filename,<br>
> but instead I got 10 files with the expected filenames, and all containing<br>
> every test message, no matter which verbosity level it was output at.<br>
> <br>
> I'm sure there's just something basic which I haven't understaood from<br>
> <br>
> <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Verbose" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Verbose</a><br>
> <br>
> and<br>
> <br>
> <a href="https://wiki.asterisk.org/wiki/display/AST/Logging+Configuration" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Logging+Configuration</a><br>
> <br>
> <br>
> Can someone please show me what I'm missing, so that I can get each<br>
> Verbose(N,Message) dialplan command to send its message into the log file<br>
> numbered N?<br>
> <br>
> <br>
> Thanks,<br>
> <br>
> <br>
> Antony.<br>
<br>
-- <br>
The Magic Words are Squeamish Ossifrage.<br>
<br>
                                                   Please reply to the list;<br>
                                                         please *don't* CC me.<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div>