I have a simple Python snippet managed by a
systemd service which logs to the
rsysogd daemon where I've defined a configuration file to put it to a syslog server with a format I've defined. This is working fine so far.
In the code below, I'm passing the argument as the string I want to log on the server. I'm using this code below as a module and using it for logging alone, the actual script uses this for logging purposes.
#!/usr/bin/env python import syslog import sys syslog.openlog(facility=syslog.LOG_LOCAL0) syslog.syslog(syslog.LOG_INFO, sys.argv)
Since the application is managed by
systemd it is making a copy of the syslog available when seen from the
journalctl -xe and the
journalctl -u <my-service> which I do not wish to happen because I've other critical information I'm logging in journal logs.
The service definition is
[Unit] Description=Computes device foobar availability status [Service] Type=simple EnvironmentFile=/etc/sysconfig/db_EndPoint ExecStart=/usr/bin/python /opt/foobar/foobar.py WatchdogSec=60 RestartSec=10 Restart=always LimitNOFILE=4096 [Install] WantedBy=default.target
and in the
/etc/systemd/journald.conf file, I've not enabled any of the options to be available. I looked up this journald.conf documentation to use
ForwardToSyslog=no and did a restart of
journald service as
systemctl restart systemd-journald
and also restarted my service unit, but I see the logs out to the syslog server and also to the journal logs. What option I'm missing here?