How to configure logrotate with php logs

后端 未结 2 1194
心在旅途
心在旅途 2021-01-12 00:59

I\'m running php5 FPM with APC as an opcode and application cache. As is usual, I am logging php errors into a file.

Since that is becoming quite large, I tried to c

2条回答
  •  伪装坚强ぢ
    2021-01-12 01:51

    Another solution I found on a server of mine is to tell php to reopen the logs. I think nginx has this feature too, which makes me think it must be quite common place. Here is my configuration :

    /var/log/php5-fpm.log {
            rotate 12
            weekly
            missingok
            notifempty
            compress
            delaycompress
            postrotate
                    invoke-rc.d php5-fpm reopen-logs > /dev/null
            endscript
    }
    

提交回复
热议问题