I have the following config in a systemd service:
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=udocit
And this rsyslog conf file:
if $programname == 'udocit' and $syslogseverity > 5 then {
action(
type="omfile"
FileCreateMode="0640"
File="/var/log/udocit.log"
)
& stop
}
if $programname == 'udocit' and $syslogseverity <= 5 then {
action(
type="omfile"
FileCreateMode="0640"
File="/var/log/udocit.err"
)
& stop
}
The service starts a nodejs app.
I would expect that messages which come from the console.error()
function, which outputs to stderr, would go to the udocit.err file with this config, but all messages are instead written to the udocit.log file.
What am I doing wrong here?