Learn about Centmin Mod LEMP Stack today
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
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    5:25 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,848
    6,904
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,394
    Local Time:
    7:25 PM
    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           
    }