By default the OpenSIPS log messages get written to the system log file /var/log/messages. How can this be changed to something else like /var/log/opensips for instance?
It is possible to log these messages to another place, but it requires both OpenSIPS and system administration knowledge and experience. Please refer to the following link. Although this document is not directly for OpenSIPS, it should work for OpenSIPS (OpenSIPS is forked from OpenSER and SER). One important part is that you must configure async mode in syslog (syslog for RHEL5/CentOS5 or rsyslog for RHEL6/CentOS6) for OpenSIPS log.
[ospadmin@OSPREY opensips]$ vi $OpenSIPS_HOME/etc/opensips/opensips.cfg debug=3 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E) sip_warning=no log_facility=LOG_LOCAL6
# Write opensips logs into a useful place local6.* -/var/log/opensips
$ pkill -9 opensips
The application will restart within one minute. The restart script runs every minute from user ospadmin’s crontab schedule.
# service rsyslog restart
# /etc/init.d/rsyslog restart