Ubuntu 16.04.2 LTS version: kamailio 4.3.4 (x86_64/linux)
/etc/kamailio/kamailio.cfg: ``` ### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR #!ifdef WITH_DEBUG debug=4 log_stderror=yes #!else debug=2 log_stderror=no #!endif
memdbg=5 memlog=5
log_facility=LOG_LOCAL0
```
/etc/rsyslog.d/50-default.conf ``` local0.* -/var/log/kamailio.log ```
kamailio.log file ``` -rw-r--r-- 1 syslog adm 1788189 Apr 14 12:09 /var/log/kamailio.log ```
If i disable WITH_DEBUG in kamailio config - it writes log to /var/log/kamailio.log, if i enable it - kamailio write logs to /var/log/syslog.
Of course, i already tried to restart rsyslog/kamailio and reboot server.
If you enable WITH_DEBUG you also enable the option "log_stderror". This option redirects logging to stderr, which is what you see.
Please check the documentation for that option.
Closed #1070.
some dirty work around worked for me. Now, I can see DEBUG messages in my custom log file.
#!ifdef WITH_DEBUG debug=4 log_stderror=no **(changed from yes)** #!else debug=2 log_stderror=no #!endif
i did the following and it is working fine for me
kamailio.cfg
`log_stderror=no`
/etc/rsyslog.d/50-default.conf
`local0.* -/var/log/kamailio.log`
**touch /var/log/kamailio.log chmod 777 /var/log/kamailio.log**
service rsyslog restart service kamailio restart