rtpengine : enable log to local2 instead of daemon doesn't work

963 views
Skip to first unread message

Youssef Boujraf

unread,
Mar 16, 2022, 6:11:51 AM3/16/22
to rtpengine
Dear

I have configured my rsyslog.conf with :

local2.* -/var/log/sipsecure/rtpengine.log
local3.* -/var/log/sipsecure/rtpengine_cdr.log

rtpengine.conf :

log-level = 7 # log-stderr = false log-facility = local2 # log-facility-cdr = local3 # log-facility-rtcp = local2

But rtpengine continue to record log into daemon.log even I have restarted syslog and daemon-reload

Any idea where I am wrong.

Best Regards,

Richard Fuchs

unread,
Mar 16, 2022, 9:42:56 AM3/16/22
to rtpe...@googlegroups.com

How are you starting rtpengine? Via systemd? If so, the systemd unit explicitly enables logging to stderr (overriding the config file) as systemd is in charge of handling the logging. So in this case, either override the systemd unit, or tell systemd to send the logging elsewhere.

Cheers

Boujraf, Youssef

unread,
Mar 16, 2022, 9:46:10 AM3/16/22
to Richard Fuchs, rtpe...@googlegroups.com
Dear
Yes it is with systemd

Then do I need to force

log-stderr = false to stop to get log to daemon ?

Best Regards

Youssef



--
You received this message because you are subscribed to a topic in the Google Groups "rtpengine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rtpengine/GprCOY21TPQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rtpengine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rtpengine/050fd852-e18b-439a-b5cc-41587a50e433%40sipwise.com.
For more options, visit https://groups.google.com/d/optout.

Boujraf, Youssef

unread,
Mar 16, 2022, 9:49:30 AM3/16/22
to Richard Fuchs, rtpe...@googlegroups.com
This is the rules from rsyslog.conf

###############
#### RULES ####
###############

#
# First some standard log files.  Log by facility.
#
local0.*                        -/var/log/sipsecure/kamailio.log
local2.*                        -/var/log/sipsecure/rtpengine.log
local3.*                        -/var/log/sipsecure/rtpengine_cdr.log
local1.*                            -/var/log/sudo.log
auth,authpriv.*;local1.none        -/var/log/auth.log
.;auth,authpriv.none            -/var/log/syslog
#cron.*                            /var/log/cron.log
daemon.*                        -/var/log/daemon.log
kern.*                            -/var/log/kern.log
lpr.*                            -/var/log/lpr.log
mail.*                            -/var/log/mail.log
user.*                            -/var/log/user.log

 Youssef

Richard Fuchs

unread,
Mar 16, 2022, 9:54:22 AM3/16/22
to rtpe...@googlegroups.com
On 16/03/2022 09.45, [EXT] Boujraf, Youssef wrote:
Dear
Yes it is with systemd

Then do I need to force

log-stderr = false to stop to get log to daemon ?

You need to go through systemd.

Use `sudo systemctl edit rtpengine` to create or edit an override file. Use a [Service] section and either override the `ExecStart` line (removing the -E option which is what forces logging to stderr), or better yet tell systemd directly to use a different syslog facility:

[Service]
SyslogFacility=local2

You can find more details in the systemd docs, e.g. https://www.freedesktop.org/software/systemd/man/systemd.exec.html

Cheers

Boujraf, Youssef

unread,
Mar 16, 2022, 10:08:05 AM3/16/22
to Richard Fuchs, rtpe...@googlegroups.com
Dear,

kamailio:/etc$ sudo systemctl edit rtpengine
Editing "/etc/systemd/system/rtpengine-daemon.service.d/override.conf" canceled: temporary file is empty.

But the path doesn't exist ?

Youssef


--
You received this message because you are subscribed to a topic in the Google Groups "rtpengine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rtpengine/GprCOY21TPQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rtpengine+...@googlegroups.com.

Youssef Boujraf

unread,
Mar 16, 2022, 4:09:53 PM3/16/22
to rtpengine
Dear,

thank you so much.

Finally I found the way. it was missing --full to access to the config

    sudo systemctl edit rtpengine --full

then I updated the config as you mentioned in the previous mails.

[Unit]
Description=NGCP RTP/media Proxy Daemon
After=network-online.target
After=remote-fs.target
Requires=network-online.target

[Service]
Type=notify
EnvironmentFile=/etc/default/rtpengine-daemon
PIDFile=/run/rtpengine-daemon.pid
ExecStartPre=/usr/sbin/rtpengine-iptables-setup start
# ExecStart=/usr/sbin/rtpengine -f -E --no-log-timestamps --pidfile /run/rtpengine-daemon.pid --config-file /etc/rtp>
ExecStart=/usr/sbin/rtpengine -f --no-log-timestamps --pidfile /run/rtpengine-daemon.pid --config-file /etc/rtpengin>
ExecStopPost=/usr/sbin/rtpengine-iptables-setup stop
SyslogFacility=local2

[Install]
WantedBy=multi-user.target

Restarted the rtpengine-daemon service and now my /var/log/rtpengine.log is collecting all the rtpengine log and /var/log/daemon.log is not receiving the log from rtpengine anymore.



Best Regards,
Reply all
Reply to author
Forward
0 new messages