• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Error log too big in size

abdallahoraby

New Pleskian
Could you support please as my error.log in /var/log/plesk-php80-fpm size is always over 50 GB, can i delete it manually first, and second is there any way to solve this issue automatically.

Screenshot_20210418_120709.png
 
The logrotate configuration file for fpm services is located in /etc/logrotate.d/ directory:

Code:
# ls -l /etc/logrotate.d/*php*
-rw-r--r-- 1 root root 203 Nov 15 23:36 /etc/logrotate.d/php-fpm
-rw-r--r-- 1 root root 211 Jan 9 13:25 /etc/logrotate.d/plesk-php56
-rw-r--r-- 1 root root 211 Jan 9 12:46 /etc/logrotate.d/plesk-php70
-rw-r--r-- 1 root root 211 Jan 9 11:11 /etc/logrotate.d/plesk-php71
-rw-r--r-- 1 root root 211 Jan 9 14:50 /etc/logrotate.d/plesk-php72

Modify the corresponding file for required php-fpm service in an appropriate way:
For example, for system php-fpm /etc/logrotate.d/php-fpm file will look like the following:

Code:
/var/log/php-fpm/*log {
    rotate 14
    daily
    missingok
    notifempty
    size 100M
    compress
    missingok
    notifempty
    sharedscripts
    delaycompress
    postrotate
        /bin/kill -SIGUSR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

Note: parameters rotate (specified in days), size and daily (or monthly, weekly) can be changed to meet the requirements.
If it is required to rotate log files more often, then remove parameter daily from the config above and create a cron task. For example, the following will run logrotate every 5 hours:

Code:
# crontab -e
01 01,06,11,16,21 * * *  /usr/sbin/logrotate /etc/logrotate.d/php-fpm -s /var/lib/logrotate/logrotate.status
 
The logrotate configuration file for fpm services is located in /etc/logrotate.d/ directory:

Code:
# ls -l /etc/logrotate.d/*php*
-rw-r--r-- 1 root root 203 Nov 15 23:36 /etc/logrotate.d/php-fpm
-rw-r--r-- 1 root root 211 Jan 9 13:25 /etc/logrotate.d/plesk-php56
-rw-r--r-- 1 root root 211 Jan 9 12:46 /etc/logrotate.d/plesk-php70
-rw-r--r-- 1 root root 211 Jan 9 11:11 /etc/logrotate.d/plesk-php71
-rw-r--r-- 1 root root 211 Jan 9 14:50 /etc/logrotate.d/plesk-php72

Modify the corresponding file for required php-fpm service in an appropriate way:
For example, for system php-fpm /etc/logrotate.d/php-fpm file will look like the following:

Code:
/var/log/php-fpm/*log {
    rotate 14
    daily
    missingok
    notifempty
    size 100M
    compress
    missingok
    notifempty
    sharedscripts
    delaycompress
    postrotate
        /bin/kill -SIGUSR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

Note: parameters rotate (specified in days), size and daily (or monthly, weekly) can be changed to meet the requirements.
If it is required to rotate log files more often, then remove parameter daily from the config above and create a cron task. For example, the following will run logrotate every 5 hours:

Code:
# crontab -e
01 01,06,11,16,21 * * *  /usr/sbin/logrotate /etc/logrotate.d/php-fpm -s /var/lib/logrotate/logrotate.status

Really i appreciate your help and reply. It solved my problem and i create the cron job via plesk gui is it the same ?

1619006627262.png
 
Back
Top