System information
There is a sample logger.conf file that comes with the Asterisk source, but rather than
just copying over the sample file, we recommend that you use the following for your
initial logger.conf file:
[general]
[logfiles]
console => notice,warning,error,dtmf
messages => notice,warning,error
;verbose => notice,warning,error,verbose
When you have saved the file, you will need to reload the logger by issuing the following
command from the shell:
$ asterisk -rx 'logger reload'
or from the Asterisk CLI:
*CLI> logger reload
Verbose Logging: Useful but Dangerous
We struggled with whether to recommend adding the following line to your
logger.conf file:
verbose => notice,warning,error,verbose
This is quite possibly one of the most useful debugging tools you have when building
and troubleshooting a dialplan, and therefore it is highly recommended. The danger
comes from the fact that if you forget to disable this when you are done with your
debugging, what you will have done is leave a ticking time bomb in your Asterisk sys-
tem, which will slowly fill up the hard drive and kill your system one day, several months
or years from now, when you are least expecting it.
Use it. It’s fantastic. Just remember to turn it off when you’re done!
You can specify any filename you want, but the special filename console will in fact
print the output to the Asterisk CLI, and not to any file on the hard drive. All other
filenames will be stored in the filesystem in the directory /var/log/asterisk. The
logger.conf types are outlined in Table 24-1.
Table 24-1. logger.conf types
Type Description
notice You will see a lot of these during a reload, but they will also happen during normal call flow. A notice is simply
any event that Asterisk wishes to inform you of.
warning A warning represents a problem that could be severe enough to affect a call (including disconnecting a call because
call flow cannot continue). Warnings need to be addressed.
error Errors represent significant problems in the system that must be addressed immediately.
524 | Chapter 24: System Monitoring and Logging