[asterisk-users] How to log into separate file

Steve Edwards asterisk.org at sedwards.com
Wed Apr 7 23:37:10 CDT 2010


On Thu, 8 Apr 2010, Pham Quy wrote:

> I want to have a separate file to log what i need for my dialplan 
> without all output from Asterisk. By this way, i can easily to trace 
> problems caused by my dialplan.

You can control how much and where Asterisk logs by fiddling with 
logger.conf. Personally, I like logging through syslog so I can configure 
all of my Asterisk hosts to send all of their logging to a central log 
host. I also use syslog() in my AGIs so everything is in the same place.

For production, I use:

         syslog.local0                   = error

When I'm debugging something, I'll crank up the volume like:

         syslog.local0                   = debug,dtmf,error,event,info,\
notice,verbose,warning

If this doesn't give you the level of logging you need, you could always 
call an AGI or do something really ugly like:

         exten = *,n,                    system(logger -t foo mumble)

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list