I want to log my app so that it writes its log into its own log file. I create the log file and save it under /etc/rsyslog.dbut my app doesn't create/write to the designated file. However, once I reload rsyslog, there are log entries the next time my app runs.
I package my app into an RPM so I can write post-install scripts if necessary. Is this the proper way to handle this via post-install scripts?
/etc/rsyslog.d/serf.conf
if $programname == 'serf' then /var/log/serf.log
& ~
Sending pkill -HUP rsyslog works but I wasn't sure if that would cause any issues to other programs while they're in the middle of logging.
flags(final), it also can reload configuration without data loss, so rsyslog can (and needs to) be eliminated from any system where logging is important. – peterh Mar 15 '19 at 10:57