Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

[Solved] Error log huge

General questions about VestaCP
Locked
  • Print view
Advanced search
4 posts • Page 1 of 1
vandread911
Posts: 14
Joined: Fri Jul 25, 2014 5:03 am

[Solved] Error log huge

Post by vandread911 » Sat May 09, 2015 6:12 am

i don't know why my error log gets so big i have to remove it each week or else the site does not work,
Image - in the pic its 461 GB big

is there a way of disabling error log or limiting it to max 100mb
Last edited by vandread911 on Thu May 14, 2015 5:33 pm, edited 1 time in total.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Error log huge

Post by skurudo » Mon May 11, 2015 8:14 pm

Edit your apache/nginx in /etc/logrotate.d/ and add size option.

According to manpage:
minsize size
Log files are rotated when they grow bigger than size bytes,
but not before the additionally specified time interval (daily,
weekly, monthly, or yearly). The related size option is simi-
lar except that it is mutually exclusive with the time interval
options, and it causes log files to be rotated without regard
for the last rotation time. When minsize is used, both the
size and timestamp of a log file are considered.

size size
Log files are rotated only if they grow bigger then size bytes.
If size is followed by k, the size is assumed to be in kilo-
bytes. If the M is used, the size is in megabytes, and if G is
used, the size is in gigabytes. So size 100, size 100k, size
100M and size 100G are all valid.
maxsize size
Log files are rotated when they grow bigger than size bytes even before
the additionally specified time interval (daily, weekly, monthly,
or yearly). The related size option is similar except that it
is mutually exclusive with the time interval options, and it causes
log files to be rotated without regard for the last rotation time.
When maxsize is used, both the size and timestamp of a log file are
considered.
Example (do not copy this!)

Code: Select all

/var/log/httpd/error.log {
           rotate 5
           mail [email protected]
           size 100k
           sharedscripts
           postrotate
               /usr/bin/killall -HUP httpd
           endscript
       }
Top

vandread911
Posts: 14
Joined: Fri Jul 25, 2014 5:03 am

Re: Error log huge

Post by vandread911 » Wed May 13, 2015 3:13 pm

skurudo wrote:Edit your apache/nginx in /etc/logrotate.d/ and add size option.

According to manpage:
minsize size
Log files are rotated when they grow bigger than size bytes,
but not before the additionally specified time interval (daily,
weekly, monthly, or yearly). The related size option is simi-
lar except that it is mutually exclusive with the time interval
options, and it causes log files to be rotated without regard
for the last rotation time. When minsize is used, both the
size and timestamp of a log file are considered.

size size
Log files are rotated only if they grow bigger then size bytes.
If size is followed by k, the size is assumed to be in kilo-
bytes. If the M is used, the size is in megabytes, and if G is
used, the size is in gigabytes. So size 100, size 100k, size
100M and size 100G are all valid.
maxsize size
Log files are rotated when they grow bigger than size bytes even before
the additionally specified time interval (daily, weekly, monthly,
or yearly). The related size option is similar except that it
is mutually exclusive with the time interval options, and it causes
log files to be rotated without regard for the last rotation time.
When maxsize is used, both the size and timestamp of a log file are
considered.
Example (do not copy this!)

Code: Select all

/var/log/httpd/error.log {
           rotate 5
           mail [email protected]
           size 100k
           sharedscripts
           postrotate
               /usr/bin/killall -HUP httpd
           endscript
       }

Within:

Code: Select all

/etc/logrotate.d/httpd
mine is this:
/var/log/httpd/*log /var/log/httpd/domains/*log {
missingok
notifempty
compress
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
would i have to edit this:

Code: Select all

    missingok
    notifempty
    compress
    sharedscripts
    postrotate
        /sbin/service httpd reload > /dev/null 2>/dev/null || true
        [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
    endscript
to:

Code: Select all

           rotate 5
           mail [email protected]
           size 50M
           sharedscripts
           postrotate
               /usr/bin/killall -HUP httpd
           endscript
if i would like it to rotate when it hits 50Mb
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Error log huge

Post by skurudo » Wed May 13, 2015 10:48 pm

vandread911 wrote:if i would like it to rotate when it hits 50Mb
Look nice.
And you can edit apache2.conf and log not all error, but only critical.
Top


Locked
  • Print view

4 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password