Refer to my uwsgi setup.
cd /etc/logrotate.dsudo nano uwsgi
The following will create a daily log which keep history for 14 days.
/var/log/uwsgi/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data www-data
sharedscripts
postrotate
systemctl restart emperor.uwsgi.service >/dev/null 2>&1
# service uwsgi restart >/dev/null 2>&1
endscript
}
Debug logrotate for errors.
logrotate -d /etc/logrotate.d/uwsgi
Force run logrotate.
sudo logrotate -vf /etc/logrotate.d/uwsgi