In dealing with an unrelated issue I came across this in rsyslog.conf.
# The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron
Why is there a "-" before /var/log/maillog? This character is not present before any of the other log files specified in /etc/rsyslog.conf. I have looked in the documents to discover the purpose of the leading "-" character in the mail log file specification but either I missed the reference or it is not there to be found.
On 06/05/2012 09:30 AM, James B. Byrne wrote:
In dealing with an unrelated issue I came across this in rsyslog.conf. mail.* -/var/log/maillog
Why is there a "-" before /var/log/maillog?
man syslog.conf 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.
Le mar. 05 juin 2012 10:30:25 CEST, James B. Byrne a écrit:
In dealing with an unrelated issue I came across this in rsyslog.conf.
# The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron
Why is there a "-" before /var/log/maillog? This character is not present before any of the other log files specified in /etc/rsyslog.conf.
It means that writing to this logfile is not followed by a sync.
Hello James,
On Tue, 2012-06-05 at 10:30 -0400, James B. Byrne wrote:
In dealing with an unrelated issue I came across this in rsyslog.conf.
# The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron
Why is there a "-" before /var/log/maillog?
Better question than it appears at first glance ;) . Nothing in man rsyslog.conf on C6, but on C5 man syslog.conf it says under "ACTIONS", "Regular File":
"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."
Now whether that minus is still supported under C6 I can't tell you :) .
Regards, Leonard.
Le mar. 05 juin 2012 17:06:32 CEST, Leonard den Ottolander a écrit:
Hello James,
On Tue, 2012-06-05 at 10:30 -0400, James B. Byrne wrote:
In dealing with an unrelated issue I came across this in rsyslog.conf.
# The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron
Why is there a "-" before /var/log/maillog?
Better question than it appears at first glance ;) . Nothing in man rsyslog.conf on C6, but on C5 man syslog.conf it says under "ACTIONS", "Regular File":
"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."
Now whether that minus is still supported under C6 I can't tell you :) .
It seems this is no more necessary. From http://www.rsyslog.com/doc/v3compatibility.html : "In rsyslog v3, syncing has been turned off by default." OTOH, it doesn't hurt do let the minus sign in place.
On 06/05/2012 07:30 AM, James B. Byrne wrote:
In dealing with an unrelated issue I came across this in rsyslog.conf. [...] Why is there a "-" before /var/log/maillog?
[...]
A leading '-' indicates the the log is written asynchronously. It is a performance tune to keep writing the syslog from thrashing the system with syncs. See http://www.rsyslog.com/doc/rsyslog_conf_actions.html