Learn about Centmin Mod LEMP Stack today
Register Now

PHP-FPM Log rotation / limitations

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by JarylW, Aug 11, 2016.

  1. JarylW

    JarylW Active Member

    213
    39
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +99
    Local Time:
    10:10 PM
    Was debugging a wordpress plugin that repeatedly kept printing same lines for log too fast that it hits 100MB in seconds. Wonder what is the default log rotation for phpfpm is configured? Or if it is possible ti limit it?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,168
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    12:10 AM
    Nginx 1.13.x
    MariaDB 5.5
    default is set in /etc/logrotate.d/php-fpm
    rotates daily or sooner if it hits a max size of 500 megabytes
    Code (Text):
    /var/log/php-fpm/*.log {
            daily
            dateext
            missingok
            rotate 10
            maxsize 500M
            compress
            delaycompress
            notifempty
            postrotate
            /bin/kill -SIGUSR1 $(cat /var/run/php-fpm/php-fpm.pid 2>/dev/null) 2>/dev/null || true
            endscript           
    }