Upgrade 3CX to v18 and get it hosted free!

Asterisk Config logger.conf

Author image

Logger.conf

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

“logger reload” at the CLI will reload the configuration of the logging system.

[General] Section

dateformat

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

appendhostname

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:

  • debug
  • notice
  • warning
  • error
  • verbose
  • dtmf

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.

Examples:

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!

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.