Want more timely Centmin Mod News Updates?
Become a Member

PHP-FPM Log rotation / limitations

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

  1. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    7:11 AM
    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

    55,380
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    9:11 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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           
    }