logger.conf

The logger.conf file specifies the type and verbosity of messages logged to the various logfiles in the /var/log/asterisk/ directory. It has two sections, [general] and [logfile].

[general]

Settings under the [general] section are used to customize the output of the logs (and can safely be left blank, as the defaults serve most people very well). However, if you love to customize such things, read on.

You can define exactly how you want your timestamps to look through the use of the dateformat parameter:

dateformat=%F %T

The Linux manpage for strftime(3) lists all of the ways you can do this.

If you want to append your system’s hostname to the names of the logfiles, set appendhostname=yes. This can be useful if you have a lot of systems delivering logfiles to you.

If for some reason you do not want to log events from your queues, you can set queue_log=no.

If generic events do not interest you, instruct Asterisk to omit them from the logfiles by setting event_log=no.

[logfiles]

The [logfiles] section defines the types of information you wish to log. There are multiple ranks for the various bits of information that will be logged, and it can be desirable to separate log entries into different files. The general format for lines in the [logfiles] section is filename => levels, where filename is the name of the file to save the logged information to and levels are the types of information you wish to save.

Tip

Using console for the filename is a special exception that allows you to control the type of information sent to the Asterisk console.

A sample [logfiles] section might look like this:

[logfiles]
console => notice,warning,error
messages => notice,warning,error

You can specify logging of the following types of information:

debug

Enabling debugging gives far more detailed output about what is happening in the system. For example, with debugging enabled, you can see what DTMF tones the users entered while accessing their voicemail boxes. Debugging information should be logged only when you are actually debugging something, as it will create massive logfiles very rapidly.

verbose

When you connect to the Asterisk console and set a verbosity of 3 or higher, you’ll see output on the console showing what Asterisk is doing. You can save this output to a logfile by adding a line such as verbose_log => verbose to your logger.conf file. Note that a high amount of verbosity can quickly eat up hard drive space.

notice

A notice is used to inform you of minor changes to the system, such as when a peer changes state. It is normal to see these types of messages, and the events they indicate generally have no adverse effects on the server.

warning

A warning happens when Asterisk attempts to do something and is unsuccessful. These types of errors are usually not fatal, but they should be investigated, especially if a lot of them are seen.

error

Errors are often related to Out of Memory errors. They generally indicate serious problems that may lead to Asterisk to crash or freeze.