mirror of
https://github.com/syncthing/syncthing.git
synced 2025-12-23 14:08:06 -05:00
This adds several options for configuring the log format of timestamps
and severity levels, making it more suitable for integration with log
systems like systemd.
--log-format-timestamp="2006-01-02 15:04:05"
Format for timestamp, set to empty to disable timestamps ($STLOGFORMATTIMESTAMP)
--[no-]log-format-level-string
Whether to include level string in log line ($STLOGFORMATLEVELSTRING)
--[no-]log-format-level-syslog
Whether to include level as syslog prefix in log line ($STLOGFORMATLEVELSYSLOG)
So, to get a timestamp suitable for systemd (syslog prefix, no level
string, no timestamp) we can pass `--log-format-timestamp=""
--no-log-format-level-string --log-format-level-syslog` or,
equivalently, set `STLOGFORMATTIMESTAMP="" STLOGFORMATLEVELSTRING=false
STLOGFORMATLEVELSYSLOG=true`.
Signed-off-by: Jakob Borg <jakob@kastelo.net>
32 lines
796 B
Desktop File
32 lines
796 B
Desktop File
[Unit]
|
|
Description=Syncthing - Open Source Continuous File Synchronization for %I
|
|
Documentation=man:syncthing(1)
|
|
After=network.target
|
|
StartLimitIntervalSec=60
|
|
StartLimitBurst=4
|
|
|
|
[Service]
|
|
User=%i
|
|
Environment="STLOGFORMATTIMESTAMP="
|
|
Environment="STLOGFORMATLEVELSTRING=false"
|
|
Environment="STLOGFORMATLEVELSYSLOG=true"
|
|
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart
|
|
Restart=on-failure
|
|
RestartSec=1
|
|
SuccessExitStatus=3 4
|
|
RestartForceExitStatus=3 4
|
|
|
|
# Hardening
|
|
ProtectSystem=full
|
|
PrivateTmp=true
|
|
SystemCallArchitectures=native
|
|
MemoryDenyWriteExecute=true
|
|
NoNewPrivileges=true
|
|
|
|
# Elevated permissions to sync ownership (disabled by default),
|
|
# see https://docs.syncthing.net/advanced/folder-sync-ownership
|
|
#AmbientCapabilities=CAP_CHOWN CAP_FOWNER
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|