What is the purpose of a "-" prefix to the log file path in /etc/rsyslog.d/50-default.conf and similar files?

0

1

Among others these lines appear in the file:

auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
#cron.*                         /var/log/cron.log
#daemon.*                       -/var/log/daemon.log

What is the purpose of the leading "-" in the path? It doesn't seem to be documented in the manpage and I can't figure it out.

Lifeboy

Posted 2017-07-16T22:02:34.833

Reputation: 238

Answers

1

- before output file name increases performance (reduces number of physical IO operations) by making logging less "crash resistant". It makes sense in case of high volume less critical log entries.

http://www.rsyslog.com/doc/v8-stable/configuration/actions.html

Actions
The Action object describe what is to be done with a message. [...]
Regular File
Typically messages are logged to real files. [...] You may prefix each entry with the minus “-‘’ sign to omit syncing the file after every logging. Note that you might lose information if the system crashes right behind a write attempt. Nevertheless this might give you back some performance, especially if you run programs that use logging in a very verbose manner.

AnFi

Posted 2017-07-16T22:02:34.833

Reputation: 771