Configure rsyslog and logrotate

rsyslog

To add an rsyslog configuration file:

  1. Add a configuration file to salt/core/rsyslog/files

  2. Add a mapping to the service’s Pillar file

For example:

rsyslog:
  conf:
    91-kingfisher-summarize.conf: kingfisher-summarize.conf

The kingfisher-summarize.conf file in salt/core/rsyslog/files will be written to /etc/rsyslog.d/91-kingfisher-summarize.conf, and the rsyslog service will be restarted.

Tip

To discard a message after writing it to a regular file, add & stop as a second action on a new line.

logrotate

  1. Add a configuration file to salt/core/logrotate/files

  2. Add a mapping to the service’s Pillar file

For example:

logrotate:
  conf:
    kingfisher-summarize: kingfisher-summarize

The kingfisher-summarize file in salt/core/logrotate/files will be written to /etc/logrotate.d/kingfisher-summarize.