Re: [asterisk-users] Logging different verbosity levels

2022-05-25 Thread Antony Stone
On Wednesday 25 May 2022 at 16:54:43, aster...@phreaknet.org wrote:

> On 5/25/2022 10:41 AM, Antony Stone wrote:
> > On Wednesday 25 May 2022 at 15:27:38, aster...@phreaknet.org wrote:
> >> 
> >> 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.

Ah.  I use the Debian packaged version, which for the current stable Debian 
release is Asterisk 16.16.1 dated Feb 2021.

custom_levels definitely isn't in there.

> 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.

Indeed - thanks for the suggestion - looks like a nice feature.


Antony.

-- 
This email was created using 100% recycled electrons.

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Logging different verbosity levels

2022-05-25 Thread Antony Stone
On Wednesday 25 May 2022 at 15:27:38, aster...@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?

> 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.


Antony.

-- 
There's a good theatrical performance about puns on in the West End.  It's a 
play on words.

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Logging different verbosity levels

2022-05-25 Thread Antony Stone
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?

Hm.


Thanks again,

Antony.

-- 
Don't procrastinate - put it off until tomorrow.

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Logging different verbosity levels

2022-05-23 Thread Kevin Harwell
So this turned out more complicated than I originally thought!

My expectation:

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:

same => n,Verbose(0,Test message verbosity 0) ; gets logged to
logtest.verbose.3, logtest.verbose.2, logtest.verbose.1, and
logtest.verbose.0
same => n,Verbose(1,Test message verbosity 1) ; gets logged to
logtest.verbose.3, logtest.verbose.2, and logtest.verbose.1
same => n,Verbose(2,Test message verbosity 2) ; gets logged to
logtest.verbose.3 and logtest.verbose.2
same => n,Verbose(3,Test message verbosity 3) ; gets logged to
logtest.verbose.3
same => n,Verbose(4,Test message verbosity 4) ; nothing logged
same => n,Verbose(5,Test message verbosity 5) ; nothing logged
same => n,Verbose(6,Test message verbosity 6) ; nothing logged
same => n,Verbose(7,Test message verbosity 7) ; nothing logged
same => n,Verbose(8,Test message verbosity 8) ; nothing logged
same => n,Verbose(9,Test message verbosity 9) ; nothing logged

Reality:

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:

same => n,Verbose(7,Test message verbosity 7)

Essentially gets changed to:

same => n,Verbose(4,Test message verbosity 7)

Next, Asterisk sets the global verbose logging level according to the
following order with each level potentially overriding if greater than the
preceding:

1) core verbose level (set in asterisk.conf)
2) console level (set via system CLI, or asterisk CLI)
3) channel log level (set in logger.conf, e.g. verbose(9))

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:

*CLI> core show settings
...
Root console verbosity:  2
...

Despite the actual level being 9.

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.

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.

Hope that makes sense!

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
https://issues.asterisk.org/. Feel free to copy/paste what's here as part
of the issue description.


On Mon, May 23, 2022 at 3:29 AM Antony Stone <
antony.st...@asterisk.open.source.it> wrote:

> Hi.
>
> Does no-one else know either?  I thought this was a simple question, and
> it
> was just me being unable to find the appropriate documentation to explain
> how
> these logging levels work.
>
> Please, can anyone help?
>
> On Friday 20 May 2022 at 15:33:45, Antony Stone wrote:
>
> > Hi.
> >
> > I'm trying to use different logging verbosity levels to get dialplan
> output
> > into different log files, and there's clearly something I haven't
> > understood about how Asterisk does this...
> >
> >
> > I have the following in /etc/asterisk/logger.conf:
> >
> > [logfiles]
> > logtest.verbose.0 => verbose(0)
> > logtest.verbose.1 => verbose(1)
> > logtest.verbose.2 => verbose(2)
> > logtest.verbose.3 => verbose(3)
> > logtest.verbose.4 => verbose(4)
> > logtest.verbose.5 => verbose(5)
> > logtest.verbose.6 => verbose(6)
> > logtest.verbose.7 => verbose(7)
> > logtest.verbose.8 => verbose(8)
> > logtest.verbose.9 => verbose(9)
> >
> > I then put the following at a particular point in my dialplan:
> >
> > same => n,Verbose(0,Test message verbosity 0)
> > same => n,Verbose(1,Test message verbosity 1)
> > same => n,Verbose(2,Test message verbosity 2)
> > same => n,Verbose(3,Test message verbosity 3)
> > same => n,Verbose(4,Test message verbosity 4)
> > same => n,Verbose(5,Test message verbosity 5)
> > same => n,Verbose(6,Test message verbosity 6)
> > same => n,Verbose(7,Test message verbosity 7)
> > same => n,Verbose(8,Test message verbosity 8)
> > same => n,Verbose(9,Test message verbosity 9)
> >
> > I was expecting to get each message output into the respective filename,
> > but instead I got 10 files with the expected filenames, and all
> containing
> > every test message, no matter 

Re: [asterisk-users] Logging different verbosity levels

2022-05-23 Thread Antony Stone
Hi.

Does no-one else know either?  I thought this was a simple question, and it 
was just me being unable to find the appropriate documentation to explain how 
these logging levels work.

Please, can anyone help?

On Friday 20 May 2022 at 15:33:45, Antony Stone wrote:

> Hi.
> 
> I'm trying to use different logging verbosity levels to get dialplan output
> into different log files, and there's clearly something I haven't
> understood about how Asterisk does this...
> 
> 
> I have the following in /etc/asterisk/logger.conf:
> 
> [logfiles]
> logtest.verbose.0 => verbose(0)
> logtest.verbose.1 => verbose(1)
> logtest.verbose.2 => verbose(2)
> logtest.verbose.3 => verbose(3)
> logtest.verbose.4 => verbose(4)
> logtest.verbose.5 => verbose(5)
> logtest.verbose.6 => verbose(6)
> logtest.verbose.7 => verbose(7)
> logtest.verbose.8 => verbose(8)
> logtest.verbose.9 => verbose(9)
> 
> I then put the following at a particular point in my dialplan:
> 
> same => n,Verbose(0,Test message verbosity 0)
> same => n,Verbose(1,Test message verbosity 1)
> same => n,Verbose(2,Test message verbosity 2)
> same => n,Verbose(3,Test message verbosity 3)
> same => n,Verbose(4,Test message verbosity 4)
> same => n,Verbose(5,Test message verbosity 5)
> same => n,Verbose(6,Test message verbosity 6)
> same => n,Verbose(7,Test message verbosity 7)
> same => n,Verbose(8,Test message verbosity 8)
> same => n,Verbose(9,Test message verbosity 9)
> 
> I was expecting to get each message output into the respective filename,
> but instead I got 10 files with the expected filenames, and all containing
> every test message, no matter which verbosity level it was output at.
> 
> I'm sure there's just something basic which I haven't understaood from
> 
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Verbose
> 
> and
> 
> https://wiki.asterisk.org/wiki/display/AST/Logging+Configuration
> 
> 
> Can someone please show me what I'm missing, so that I can get each
> Verbose(N,Message) dialplan command to send its message into the log file
> numbered N?
> 
> 
> Thanks,
> 
> 
> Antony.

-- 
The Magic Words are Squeamish Ossifrage.

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Logging different verbosity levels

2022-05-20 Thread Antony Stone
On Friday 20 May 2022 at 15:33:45, Antony Stone wrote:

> Hi.
> 
> I'm trying to use different logging verbosity levels to get dialplan output
> into different log files, and there's clearly something I haven't
> understood about how Asterisk does this...
> 
> 
> I have the following in /etc/asterisk/logger.conf:

Hm, the formatting of this mail seems to have got somewhat mangled on its way 
through the list server, I think - I'll edit it and try again, just so it's 
easier for people to see what I did:

> [logfiles]
> logtest.verbose.0 => verbose(0)
> logtest.verbose.1 => verbose(1)
> logtest.verbose.2 => verbose(2)
> logtest.verbose.3 => verbose(3)
> logtest.verbose.4 => verbose(4)
> logtest.verbose.5 => verbose(5)
> logtest.verbose.6 => verbose(6)
> logtest.verbose.7 => verbose(7)
> logtest.verbose.8 => verbose(8)
> logtest.verbose.9 => verbose(9)
> 
> I then put the following at a particular point in my dialplan:
> 
> same => n,Verbose(0,Test message verbosity 0)
> same => n,Verbose(1,Test message verbosity 1)
> same => n,Verbose(2,Test message verbosity 2)
> same => n,Verbose(3,Test message verbosity 3)
> same => n,Verbose(4,Test message verbosity 4)
> same => n,Verbose(5,Test message verbosity 5)
> same => n,Verbose(6,Test message verbosity 6)
> same => n,Verbose(7,Test message verbosity 7)
> same => n,Verbose(8,Test message verbosity 8)
> same => n,Verbose(9,Test message verbosity 9)
> 
> I was expecting to get each message output into the respective filename,
> but instead I got 10 files with the expected filenames, and all containing
> every test message, no matter which verbosity level it was output at.
> 
> I'm sure there's just something basic which I haven't understaood from
> 
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Verbose
> 
> and
> 
> https://wiki.asterisk.org/wiki/display/AST/Logging+Configuration
> 
> 
> Can someone please show me what I'm missing, so that I can get each
> Verbose(N,Message) dialplan command to send its message into the log file
> numbered N?
> 
> 
> Thanks,
> 
> 
> Antony.

-- 
"There is no reason for any individual to have a computer in their home."

 - Ken Olsen, President of Digital Equipment Corporation (DEC, later consumed 
by Compaq, later merged with HP)

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users