Proper way to reload rsyslog with a config file for a custom application
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.d
but 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.
Solution 1:
Sending SIGHUP can't reload the rsyslog configure files, but only reopens the log files for rotating. Restart should reload the config files.
see https://lists.gt.net/rsyslog/users/16151