text
stringlengths
0
152
Table 21-1. logger.conf types
Type
notice
Description
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
error
debug
because call flow cannot continue). Warnings need to be addressed.
Errors represent significant problems in the system that must be addressed immediately.
Debugging is only useful if you are troubleshooting a problem with the Asterisk code itself. You would not use
debug to troubleshoot your dialplan, but you would use it if the Asterisk developers asked you to provide logs
for a problem you were reporting. Do not use debug in production, as the amount of detail stored can fill up a
hard drive in a matter of days.a
verbose This is one of the most useful of the logging types, but it is also one of the more risky to leave unattended, due
dtmf
fax
*
to the possibility of the output filling your hard drive.b
Logging DTMF can be helpful if you are getting complaints that calls are not routing from the automated
attendant correctly.
This type of logging causes fax-related messages from the fax technology backend (res_fax_spandsp or
res_fax_digium) to be logged to the fax logger.
This will log everything (and we mean everything). Do not use this unless you understand the implications of
storing this amount of data. It will not end well.
a This is not theory. It has happened to us. It was not fun.
b It’s not as risky as debug, since it’ll take months to fill the hard drive, but the danger is that it will happen, say, a year later
when you’re on summer vacation, and it will not immediately be obvious what the problem is. Not fun.
There is a peculiarity in Asterisk’s logging system that will cause
you some consternation if you are unaware of it. The level of log‐
ging for the verbose and debug logging types is tied to the verbo‐
sity as set in the console. This means that if you are logging to a file
with the verbose or debug type, and somebody logs into the CLI
and issues the command core set verbose 0, or core set debug
0, the logging of those details to your logfile will stop.
Reviewing Asterisk Logs
Searching through logfiles can be a challenge. The trick is to be able to filter what you
are seeing so that you are only presented with information that is relevant to what
you are searching for.
To start with, you will need to have an approximate idea of when the trouble you are
looking for occurred. Once you are oriented to the approximate time, you will need
to find clues that will help you to identify the call in question. Obviously, the more
information you have about the call, the faster you will be able to pin it down.
Asterisk 11 introduced a logging feature that helps with debugging a specific call. Log
entries associated with a call now include a call ID. This call ID can be used with grep
logger.conf
|
353
to find all log entries associated with that call. In the following example log entry, the
call ID is C-00000004:
[Dec 4 08:22:32] WARNING[14199][C-00000004]: app_voicemail.c:6286
leave_voicemail: No entry in voicemail config file for '234123452'
In earlier versions of Asterisk, there is another trick you can use. If, for example, you
are doing verbose logging, you should note that each distinct call has a thread identi‐
fier, which, when used with grep, can often help you to filter out everything that does
not relate to the call you are trying to debug. For example, in the following verbose
log, we have more than one call in the log, and since the calls are happening at the
same time, it can be very confusing to trace one call:
$ tail -1000 verbose
[Mar 11 …] VERBOSE[31362] logger.c: -- IAX2/shifteight-4 answered Zap/1-1
[Mar 11 …] VERBOSE[2973] logger.c: -- Starting simple switch on 'Zap/1-1'
[Mar 11 …] VERBOSE[31362] logger.c: == Spawn extension (shifteight, s, 1)
exited non-zero on 'Zap/1-1'
[Mar 11 …] VERBOSE[2973] logger.c: -- Hungup 'Zap/1-1'
[Mar 11 …] VERBOSE[3680] logger.c: -- Starting simple switch on 'Zap/1-1'
[Mar 11 …] VERBOSE[31362] logger.c: -- Hungup 'Zap/1-1'
To filter on one call specifically, we could grep on the thread ID. For example:
$ grep 31362 verbose
would give us:
[Mar 11 …] VERBOSE[31362] logger.c: -- IAX2/shifteight-4 answered Zap/1-1
[Mar 11 …] VERBOSE[31362] logger.c: == Spawn extension (shifteight, s, 1)
exited non-zero on 'Zap/1-1'