Asterisk config logger.conf


In this file, you configure logging to files or to the syslog system.

"logger reload" at the CLI will reload configuration of the logging system.

[general] section

Customize the display of debug message time stamps. see strftime(3) Linux manual for format specifiers
this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
dateformat=%F %T

This appends the hostname to the name of the log files.
appendhostname = yes

[logfiles] section

Format is "filename" and then "levels" of debugging to be included:

Special filename "console" represents the system console
syslog keyword : This special keyword logs to syslog facility. Follow it with a . and the syslog facility name to use

Note: To see the cli output use the verbose log level.

debug => debug
console => notice,warning,error
messages => notice,warning,error
full => notice,warning,error,verbose
syslog.local0 => notice,warning,error

Rotating logs

You can rotate logs by running "logger rotate" on the CLI.

You can do this from cron by putting the following in a cron job:

/usr/sbin/asterisk -r -x 'logger rotate'

On Win32 platform only you can do the following:

If you want to rotate your logs (for example starting a new log every day), use the windows scheduler. Add a new scheduled item, (eg: midnight every day / week / month) to run, and till it to run RotateLogs.vbs This script will tell Asterisk to create a new log, and then rename the old log in standard windows log format (eg: msg_YYYYMMDD.log).

The RotateLogs.vbs script file should be downloaded from Telium and copied anywhere on your disk. Edit the script for to modify the constants at the top of the file, to tell where you placed asterix.exe, where your logs files are, etc.

Then that's it!
Created by: mstahl, Last modification: Fri 29 of May, 2015 (14:37 UTC) by telium
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+