#1 (permalink)  
Old 06-04-2009, 01:07 PM
Registered User
 
Join Date: Sep 2004
Posts: 499
bsasninja is on a distinguished road
Exclamation 6GB error_log file not rotating!!!

I´m having a problem with apache error_log file at /usr/local/apache/logs/
I have deleted and created the file on monday and today is 6.3gb again, seems that is not rotating the logs daily.
I´ve 404.shtml files in all the accounts

-rw-r--r-- 1 root root 6.3G Jun 4 14:02 error_log

any help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-04-2009, 05:30 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by bsasninja View Post
I´m having a problem with apache error_log file at /usr/local/apache/logs/
I have deleted and created the file on monday and today is 6.3gb again, seems that is not rotating the logs daily.
I´ve 404.shtml files in all the accounts

-rw-r--r-- 1 root root 6.3G Jun 4 14:02 error_log

any help?
In WHM -> Service Configuration -> Apache Configuration -> Log Rotation try checking the box for "error_log" then clicking save. Note, you may want to also log rotate the rest of the logs on that page.

Unlike user's HTTP logs, these logs will be rotated once they reach 300 MB in size.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-11-2009, 02:44 AM
Registered User
 
Join Date: Mar 2004
Posts: 625
jols is on a distinguished road
cPanelDavidG, what about the error_log files that are located within the individual hosted accounts? I just found one error_log file in someone's account that was over 600,000 lines deep! Anything we can do to keep these from eating up web space, that is, without switching this feature off entirely in php.ini?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-11-2009, 01:04 PM
Registered User
 
Join Date: Sep 2004
Posts: 792
mtindor is on a distinguished road
Quote:
Originally Posted by jols View Post
cPanelDavidG, what about the error_log files that are located within the individual hosted accounts? I just found one error_log file in someone's account that was over 600,000 lines deep! Anything we can do to keep these from eating up web space, that is, without switching this feature off entirely in php.ini?
If your customer has error_log files that are huge in their own directories, let them reach quota and ask you why their account doesn't work - then you can tell them have have obvious broken PHP scripts generating copious amounts of errors.

This si really your customer's problem and not yours directly - and you should contact your customer and tell them to either fix whatever is broken and generating the huge files or tell them to go elsewhere.... or just delete the error logs yourself once in a while.

Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-11-2009, 02:20 PM
Registered User
 
Join Date: Mar 2004
Posts: 625
jols is on a distinguished road
But I am sure, as you probably know there are scripting errors which have no real impact on their scripts or anything else.

True, such errors are due to poor coding, etc. but in our view, the last thing we need are accounts failing due to "unknown" reasons. (from the customer's point of view)

And, ANYTHING to reduce support calls is a plus.

So I take it then, that it is up to us to come up with a script that regularly looks at the size of the error_log files and rotates them when they get too large?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-11-2009, 02:29 PM
Spiral's Avatar
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
We have a cronjob that sweeps error_logs from all user accounts regularly
and checks the size before deletion and the number of times it has to sweep
that particular user and above a certain threshold, it sends us an email to
go check out the user's account.

Regarding Mr. 6 GB though, it would seem you have a major problem because
there is no way the default log for the server should be growing that fast
unless there is something going on that there shouldn't be.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-11-2009, 02:30 PM
Registered User
 
Join Date: Mar 2004
Posts: 625
jols is on a distinguished road
Spiral, sounds like just what the doctor ordered.

Care to post the script that's run by your cron? Last time I tried to set up a shell script to do something like this it caused CPU overloads. I'm really not very good at this kind of thing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-11-2009, 04:21 PM
Spiral's Avatar
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
Quote:
Originally Posted by jols View Post
Spiral, sounds like just what the doctor ordered.

Care to post the script that's run by your cron? Last time I tried to set up a shell script to do something like this it caused CPU overloads. I'm really not very good at this kind of thing.
The following is not what we use ...

However, someone in another thread asked almost an identical question about error_logs literally
just a couple of minutes ago and I wrote them a quick script to locate and archive the error_log files so
here is a variation of the script I just posted in the other thread just a minute ago except rewritten
to be more used as a cronjob and may be useful to what you are doing as well and should be easily
modified to add whatever additional functionality you need:
Code:
#!/bin/bash
IFS="$"

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/mbin:.

export PATH
unset USERNAME

TLOG="/tmp/tmp_error_search.$$"
ELOG="/var/log/client_error_logs.log

# Reset temporary work file if exists
if [ -e ${TLOG} ]; then
   rm -f ${TLOG}
   /bin/touch ${TLOG}
   /bin/chmod 600 ${TLOG}
fi

cd /home   #Nice starting point

ls /var/cpanel/users | while read CPLN; do
    echo "$(date) I will now search ${CPLN}'s account for PHP error_log files ..." >> ${ELOG}
    find /home/${CPLN}/public_html -type f -name 'error_log' > ${TLOG}
done

if [ -e ${TLOG} ]; then
  echo "$(date) I have built my list of error_log files and am now archiving those files ..."  >> ${ELOG}
  cat ${TLOG} | while read MLINE; do
     if [ -e ${MLINE}.bz2 ]; then
        rm -f ${MLINE}.bz2 
        echo "$(date) Removed old archive ${MLINE}.bz2 from hard drive ..."  >> ${ELOG}
     fi
     echo "$(date) Compressing ${MLINE} into new bzip2 archive ..." >> ${ELOG}
     bzip2 -9 "${MLINE}" > /dev/null 2>&1
  done
  rm -f ${TLOG}
fi

Last edited by Spiral; 07-11-2009 at 05:44 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-11-2009, 04:53 PM
Registered User
 
Join Date: Mar 2004
Posts: 625
jols is on a distinguished road
Cool. Thanks very much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error_log File cancer10 cPanel and WHM Discussions 3 05-13-2008 01:33 AM
error_log file in every directory? nurseryboy cPanel and WHM Discussions 2 12-13-2006 12:38 PM
site-log 6GB Adrnalnrsh cPanel and WHM Discussions 0 06-29-2006 07:16 PM
Why isn't rotatelog used for rotating the access_log and error_log files? anup123 cPanel and WHM Discussions 3 11-30-2004 03:11 PM
is this normal in the error_log file ? silvernetuk cPanel and WHM Discussions 1 12-11-2002 03:31 PM


All times are GMT -5. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc