I enabled error_log = /var/log/php5-fpm.log under /etc/php5/fpm/php-fpm.conf on my ubuntu 12.04 with nginx and php5-fpm running.
But I noticed that php5-fpm.log is not freezing. I tried to understand some of the settings that I found from the Internet, but I do not want to test them on my production server.
Here are some of the configurations found:
/var/log/php5-fpm.log { rotate 12 weekly missingok notifempty compress delaycompress postrotate invoke-rc.d php5-fpm reopen-logs > /dev/null endscript }
This is the link in the config. As far as I understand, I only need to create a file under php5-fpm under /etc/logrotate.d/ , so it will look like /etc/logrotate.d/php5-fpm and with the above code.
I also found another example from this with the following code:
/var/log/php5-fpm.log { daily missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate [ ! -f /var/run/php5-fpm.pid ] || kill -USR1 `cat /var/run/php5-fpm.pid` endscript }
Since I'm new to setting up logrotate, I want to make sure I do the right thing.
So which of the two configurations is correct? First or second? And is it right that I only create the file in /etc/logrotate.d/php5-fpm and put the code there?
Sorry if this is a newbie question, I just can't find a complete explanation of how to do this.
source share