Kamailio Log Management

Separate Log File for Kamailio

In order to create a separate log file for kamailio, you would need to edit two files.

First , set the log_facility directive :

vi kamailio.cfg
log_facility=LOG_LOCAL0

Edit the syslog configuration file depending upon your daemon

vi /etc/rsyslog.conf

or

vi /etc/syslog.conf
local0.*			-/var/log/kamailio.log
service kamailio restart
service syslog/rsyslog restart

 

Rotating Kamailio Logs :

vi /etc/logrotate.d/kamailio.log
/var/log/kamailio.log {
    missingok
    size=50M
    create 0644 root root
    postrotate
	   /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

You may also like...