## Global
compress
copytruncate
notifempty

## Rules engine
/var/log/st2/st2rulesengine.audit.log {
  rotate 5
  size 10M
  postrotate
    st2ctl reopen-log-files st2rulesengine > /dev/null
  endscript
}

/var/log/st2/st2rulesengine.log {
  size 100M
  rotate 5
  postrotate
    st2ctl reopen-log-files st2rulesengine > /dev/null
  endscript
}

## AUTH
/var/log/st2/st2auth.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2auth > /dev/null
  endscript
}

/var/log/st2/st2auth.audit.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2auth > /dev/null
  endscript
}

## API
/var/log/st2/st2api.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2api > /dev/null
  endscript
}

/var/log/st2/st2api.audit.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2api > /dev/null
  endscript
}

## Stream
/var/log/st2/st2stream.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2stream > /dev/null
  endscript
}

/var/log/st2/st2stream.audit.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2stream > /dev/null
  endscript
}

## Notifier
/var/log/st2/st2notifier*.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2notifier > /dev/null
  endscript
}

## Sensor Containers
/var/log/st2/st2sensorcontainer*.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2sensorcontainer > /dev/null
  endscript
}

## Action Runners
/var/log/st2/st2actionrunner*.log {
  daily
  rotate 5
  postrotate
    # Delete all files that haven't been modified in over 30 days
    # Clean up stale PID logs
    find /var/log/st2/ -type f -name "st2actionrunner*.log*" -mtime +30 -exec rm -f {} \;
    st2ctl reopen-log-files st2actionrunner > /dev/null
  endscript
}

## Scheduler
/var/log/st2/st2scheduler*.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2scheduler > /dev/null
  endscript
}

## Workflow Engine
/var/log/st2/st2workflowengine*.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2workflowengine > /dev/null
  endscript
}

## Garbage collector
/var/log/st2/st2garbagecollector*.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2garbagecollector > /dev/null
  endscript
}

## Timers engine
/var/log/st2/st2timersengine*.log {
  daily
  rotate 5
  postrotate
    st2ctl reopen-log-files st2timersengine > /dev/null
  endscript
}
