mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-26 10:30:46 +00:00
fix(server): require additional variable to enable systemd logging (#5222)
* fix(logging): require additional variable to enable systemd logging * use a better name
This commit is contained in:
parent
221d301c42
commit
8a19fa9991
2 changed files with 4 additions and 1 deletions
|
|
@ -248,6 +248,7 @@ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}}
|
|||
TimeoutStopSec=20
|
||||
RestartSec=120
|
||||
EnvironmentFile=-/etc/sysconfig/{{.Name}}
|
||||
Environment="ND_SYSTEMD_PRIORITY_LOGGING=1"
|
||||
|
||||
DevicePolicy=closed
|
||||
NoNewPrivileges=yes
|
||||
|
|
|
|||
|
|
@ -341,9 +341,11 @@ func Load(noConfigDump bool) {
|
|||
os.Exit(1)
|
||||
}
|
||||
log.SetOutput(out)
|
||||
} else if os.Getenv("JOURNAL_STREAM") != "" {
|
||||
} else if os.Getenv("ND_SYSTEMD_PRIORITY_LOGGING") != "" && os.Getenv("JOURNAL_STREAM") != "" {
|
||||
// When running under systemd, prepend syslog priority prefixes so
|
||||
// journald assigns the correct severity to each log line.
|
||||
// Note that we have an additional environment variable, as JOURNAL_STREAM
|
||||
// can be present in a systemd environment even if not running as a systemd service
|
||||
log.EnableJournalFormat()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue