My logs are being rotated properly, however, I am not being emailed the rotated log. What am I doing wrong?
My main logrotate.conf is:
include /etc/logrotate.d
here is my /etc/logrotate.d/php-errors:
/var/log/php-errors.log {
rotate 7
daily
missingok
notifempty
mail [email protected]
}
You will need to ensure that you have sendmail (or an equivalent MTA) correctly configured to be capable of sending mail out, then specify the full path to the command in your configuration as above in
/etc/logrotate.d/php-errors
;Turns out I was misunderstand the mail command. It mails the log that is about to be deleted. I wanted the log that was just rotated, so I had to add the "mailfirst" directive to my configuration file.