Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kamailio + rsyslog, still writing logs to /var/log/syslog in DEBUG_MODE #1070

Closed
lgg opened this issue Apr 14, 2017 · 4 comments
Closed

Kamailio + rsyslog, still writing logs to /var/log/syslog in DEBUG_MODE #1070

lgg opened this issue Apr 14, 2017 · 4 comments

Comments

@lgg
Copy link

lgg commented Apr 14, 2017

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.

@lgg
Copy link
Author

lgg commented Apr 14, 2017

Of course, i already tried to restart rsyslog/kamailio and reboot server.

@oej
Copy link
Member

oej commented Apr 14, 2017

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.

@oej oej closed this as completed Apr 14, 2017
@ganeshbms
Copy link

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

@dpk1228
Copy link

dpk1228 commented Mar 17, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants