• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved HUGE GBs LOGS FILES

LwStudio

New Pleskian
I got these 2 issue:

1. A domain has 12.7GB of logs as: Nginx Error - logs/proxy_error_log
The rotate seems to not work with this file, and from the Logs Dashboard of the domain is not allowed to delete it.
Is it safe manually delete it from SSH? Or...other solution?

2. A got 30.2GB of logs in this file: /var/log/plesk-php74-fpm/error.log
Also for this log the rotate does not seem to work.
Is it safe manually delete it from SSH? Or...other solution?

I try, with no success, to follow this article, entering a daily rotation

SERVER:
Centos8 64bit - VPS - OBSIDIAN 18.0.35

Many thanks for some support.
 

Attachments

  • SCREEN_PLESK.png
    SCREEN_PLESK.png
    188.5 KB · Views: 18
It is safe to manually delete log files, however, you need to restart the corresponding service afterwards, because running services might have open file handles in RAM to the log file destination, so new entries cannot be written, if the file is suddenly missing from disk.
 
You may also want to check the contents of those error logs to see what causes such a huge amount of errors. Most of the time it's bad PHP code that spits out errors in a loop (for example, PHP code that tries to read a file in a while-loop without checking if that file really exists).

In case you see the same error repeated over and over again in your error logs you may want to consider setting ignore_repeated_errors = On in your php.ini for this domain (or your service plan or server-wide)
 
It is safe to manually delete log files, however, you need to restart the corresponding service afterwards, because running services might have open file handles in RAM to the log file destination, so new entries cannot be written, if the file is suddenly missing from disk.
Ok, many thanks Peter. Do you mind give the command to restart the service for this file /var/log/plesk-php74-fpm/error.log

Or you mean an engine services restart as:
Code:
# service sw-engine restart && service sw-cp-server restart
 
Last edited:
You may also want to check the contents of those error logs to see what causes such a huge amount of errors. Most of the time it's bad PHP code that spits out errors in a loop (for example, PHP code that tries to read a file in a while-loop without checking if that file really exists).

In case you see the same error repeated over and over again in your error logs you may want to consider setting ignore_repeated_errors = On in your php.ini for this domain (or your service plan or server-wide)
Ok Monty thanks for the tip. It's something I wanted to do but I was afraid to open a 30GB file had never happened to me in the past ... maybe I download it locally and open it to see if there's some loop.
 
Ok Monty thanks for the tip. It's something I wanted to do but I was afraid to open a 30GB file had never happened to me in the past ... maybe I download it locally and open it to see if there's some loop.

You can open it directly on the server using a file viewer (not editor!) such as "less". Saves you a lot of downloading ;)
 
Back
Top