1

In myapp.service, I have :

StandardOutput=syslog
StandardErr=syslog

When I do :

$ journalctl -e -u myapp

I can see each line of log contains "myapp[PID]".

I've tried to set up /etc/rsyslog.d/myapp.conf with :

if $msg contains 'myapp' then /opt/myapp/log/myapp.log
& stop

or

if $programname == 'myapp' then /opt/myapp/log/myapp.log
& stop

Each time checking syntax with "rsyslogd -N1" and restarting rsyslogd.

But log message is not routed, nothing is written in myapp.log

Could it be because of my rsyslog version (8.16) ? or some permission issue ? I've tried to touch the log file but it didn't work.

1

It was some permission issues: chmod 666 myapp.log fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.