[Freeswitch-users] LogLevel from XML dialplan?

Antony Stone Antony.Stone at freeswitch.open.source.it
Tue Nov 1 15:24:58 UTC 2022


On Tuesday 01 November 2022 at 16:18:15, Antony Stone wrote:

> On Tuesday 01 November 2022 at 16:01:01, Brian West wrote:
> > <action application="log" data="ALERT DIALING Extension"/>
> 
> That simply places the word "ALERT" at the start of the logged message.
> 
> The log level is still [INFO].

Oh, now I see - it in fact adds a *second* message to the log, this time with 
level [ALERT] and of a different syntax.  I'll see if I can deal with that...

Thanks for the pointer.

> > On Tue, Nov 1, 2022 at 9:46 AM Antony Stone wrote:
> > > On Tuesday 01 November 2022 at 14:54:54, Brian West wrote:
> > > > Remove SWITCH_LOG_ and use these log levels.
> > > 
> > > Sorry, but I don't follow.
> > > 
> > > 1. Remove SWITCH_LOG_ from where?  That string appears nowhere under
> > > /etc/freeswitch on my systems.
> > > 
> > > 2. How do I specify the log level when using XML?
> > > 
> > > Here is a dialplan command which works and inserts a log entry with the
> > > default level [INFO]:
> > > 
> > > <action application="log" data="DIALING Extension"/>
> > > 
> > > How should I change this so that the logged level is [ALERT]?
> > > 
> > > > switch_types.h: SWITCH_LOG_DEBUG            - Debug
> > > > switch_types.h: SWITCH_LOG_INFO             - Info
> > > > switch_types.h: SWITCH_LOG_NOTICE           - Notice
> > > > switch_types.h: SWITCH_LOG_WARNING          - Warning
> > > > switch_types.h: SWITCH_LOG_ERROR            - Error
> > > > switch_types.h: SWITCH_LOG_CRIT             - Critical
> > > > switch_types.h: SWITCH_LOG_ALERT            - Alert
> > > > switch_types.h: SWITCH_LOG_CONSOLE          - Console
> > > > switch_types.h: SWITCH_LOG_DEBUG10 = 110,
> > > > switch_types.h: SWITCH_LOG_DEBUG9 = 109,
> > > > switch_types.h: SWITCH_LOG_DEBUG8 = 108,
> > > > switch_types.h: SWITCH_LOG_DEBUG7 = 107,
> > > > switch_types.h: SWITCH_LOG_DEBUG6 = 106,
> > > > switch_types.h: SWITCH_LOG_DEBUG5 = 105,
> > > > switch_types.h: SWITCH_LOG_DEBUG4 = 104,
> > > > switch_types.h: SWITCH_LOG_DEBUG3 = 103,
> > > > switch_types.h: SWITCH_LOG_DEBUG2 = 102,
> > > > switch_types.h: SWITCH_LOG_DEBUG1 = 101,
> > > > switch_types.h: SWITCH_LOG_DEBUG = 7,
> > > > switch_types.h: SWITCH_LOG_INFO = 6,
> > > > switch_types.h: SWITCH_LOG_NOTICE = 5,
> > > > switch_types.h: SWITCH_LOG_WARNING = 4,
> > > > switch_types.h: SWITCH_LOG_ERROR = 3,
> > > > switch_types.h: SWITCH_LOG_CRIT = 2,
> > > > switch_types.h: SWITCH_LOG_ALERT = 1,
> > > > switch_types.h: SWITCH_LOG_CONSOLE = 0,
> > > > switch_types.h: SWITCH_LOG_DISABLE = -1,
> > > > switch_types.h: SWITCH_LOG_INVALID = 64,
> > > > switch_types.h: SWITCH_LOG_UNINIT = 1000
> > > 
> > > Thanks,
> > > 
> > > Antony.
> > > 
> > > > On Tue, Nov 1, 2022 at 8:49 AM Antony Stone wrote:
> > > > > Hi.
> > > > > 
> > > > > https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools:+l
> > > > > og tells me that I can specify the LogLevel of messages:
> > > > > 
> > > > > log [loglevel] <log message>
> > > > > 
> > > > > It also tells me that I can use the function inline in an XML
> > > > > dialplan:
> > > > > 
> > > > > <action application="log" data="DIALING Extension"/>
> > > > > 
> > > > > How do I specify the LogLevel when using XML?
> > > > > 
> > > > > 
> > > > > Thanks,

-- 
Because it messes up the order in which people normally read text.
> Why is top-posting such a bad thing?
> > Top-posting.
> > > What is the most annoying way of replying to e-mail?

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



More information about the FreeSWITCH-users mailing list