• 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
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

how to clean error_log in the rules ? and how to configue logging options ?

NaSOnWeb

Basic Pleskian
hello
I have a big issue with error_log file

root@*****:~# du -sh /var/www/vhosts/*****.com/logs
1,2T /var/www/vhosts/*****.com/logs

wahou ! OMG ! my server is almost full...
________
So, my question are ...
how can I safely delete this file ?
can I remove it directly ? should i stop apache first ?
can I delete it by plesk administration ? I see it in log files of my domain but i can't check the checkbox to delete it.


what is the safe way ?

and second quesiton...
i've mad a tail on this file and i have a billion of
Undefined variable: _SESSION in /var/www/vhosts/****.com/httpdocs/****.php on line 47
and other for each not declared var in my php code...
so

how can I configure apache to not log this notices ? I want the real errors loged but not all this notices.

thanks a lot for your help
 
can I change in plesk panel in my domain php settings > Additional directives.

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

is it a right syntax ?
must I remove the error_log file first to save my space or apache will erase it if i chnage this parameter in plesk ?
thanks
 
First of all - have you checked that your logrotation works fine?
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

is it a right syntax ?
Looks correct. You can always test and check it at least.
 
hello and thanks for your reply.
where can i see my logrotation config ?
It seems to be an issue with it ... cause i guess a 1.2Tb logfile is not normal, no ?

what is the best way to remove or clear the error_lor file ?
must I stop apache, remove the file and restart apache ? will apache recreate it ? can I remove this file with apache in use ?
must I empty the file (but nor remove it ? )

thanks
 
hello
here is my config for logrotate.
all is enabled but nothing seems to happens
thanks
 

Attachments

  • Plesk_12.0.18_-_2016-02-03_18.38.45.png
    Plesk_12.0.18_-_2016-02-03_18.38.45.png
    17.5 KB · Views: 14
Try to check that this huge log will be rotated with running following command:

# /usr/local/psa/logrotate/sbin/logrotate /usr/local/psa/etc/logrotate.d/domain.com -s /usr/local/psa/var/logrotate.status
 
ok. i will try. but my server is 84% full ... i'm affraid that running logrotate will full the disk and crash the server :(
thnaks
 
ok. i will try. but my server is 84% full ... i'm affraid that running logrotate will full the disk and crash the server :(
thnaks
This command will rotate logs only for particular domain and will not affect other domains.
 
ok understand. but this specific domain has the 1.2Tb error_log file. (the reason of my stress)

is it a good idea to clear the file with this kind of command ? (with apache in use)
Code:
echo > /var/www/vhosts/xxxxx.com/logs/error_log
 
Yes, you can. But interesting question is why logrotation for this logs didn't work?
 
hello
i've tested the comand line
/usr/local/psa/logrotate/sbin/logrotate /usr/local/psa/etc/logrotate.d/my-real-domain.com -s /usr/local/psa/var/logrotate.status

but the file "my-real-domain.com" does not exist (and effectively i can't found the file in the folder)

I will set up the logrotate to daily in plesk in the config page of my domain to see if tomorrow the file is processed

thanks
 
yes of course ;) i did it with my domain name... (we can say aaaa.com)
but in directory /usr/local/psa/etc/logrotate.d/ i can see files for a lot of my domains (bbb.com, ccc.com ...) but not the primary one (aaa.com).

this server has a specific config for my domains.
Indeed, they share the same root directory on my server (It's a home made multisite CMS, I display the good website function of the called domain). I don't know if it can have an effect.

The problematic error_log file is for the primary domain (the first one I create).

so yesterday night i've changed the logrotate config to daily on aaa.com plesk config but this morning, nothing has changed... I do not know what time it is supposed to be scheduled.
I can wait until tomorrow to see.

Just two questions
can I check if the process is in progress ?
and where can I find the logrotate config file for aaa.com ?

thanks
 
so ... l've stopped apache via ssh and cleared the file
Code:
echo > /var/www/vhosts/xxxxx.com/logs/error_log
and restarted apache ...
all is working now but i don't know why logrotate did not work
 
What is result of command which was provided by me above? Could you please show me full output?
 
Back
Top