disable logging to syslog in Ubuntu 16.04

Hi all,

Syncthing is awesome, I love it!

However, I recently discovered that it outputs a log to syslog. I’d like to stop that.

I use the following repository in Ubuntu 16.04 https://apt.syncthing.net/ syncthing stable

Thus the systemd service file looks like this:

[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
Wants=syncthing-inotify@.service

[Service]
User=%i
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
Restart=on-failure
SuccessExitStatus=3 4
RestartForceExitStatus=3 4

[Install]
WantedBy=multi-user.target

I can not use the -logfile command line option, as it can not be used with -no-restart.

I dont care if the logging output goes to a different file or to no file at all. As I understand, it is in the system journal in any case. I just dont wont it in syslog.

Anyone who can help?

Logging goes via systemd in this setup so you want to figure out how to disable logging or syslog forwarding for a specific program in systemd. I think systemd by default logs to syslog in Ubuntu for compatibility.

In the system systemd config there is DefaultStandardOutput if its value is syslog you can just override that for syncthing by adding these lines to the service section:

StandardOutput=journal
StandardError=journal

However on debian this works different: DefaultStandardOutput is journal but nevertheless systemd sends everything to /run/systemd/journal/syslog where rsyslogd apparently also reads from without any configuration. That’s how I get stuff into both syslog and journal. If that’s the case you can either use filtering rules on the syslog side or set the syncthing service to log to a file, e.g. (systemd will not do any log rotation)

StandardOutput=/var/log/syncthing.log
StandardError=/var/log/syncthing.log

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.