Jun 22, 2005
11
0
151
My susexec logfile is getting pretty big (800meg+) logging every PHP script the server runs -- is that normal? Should it automatically rotating off, or is that something that needs to be setup?

Tks in advance
 

darren.nolan

Well-Known Member
Oct 4, 2007
257
0
66
800mb depending on how many customers you are server, is probably fine. I don't believe suexec rotates, but suphp does (is that right cPanel? I recall a post saying that later builds of cPanel would automatically rotate suphp's log as intended).

As suexec is becoming older, I believe you may want to rotate that file yourself.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
cpanellogd will rotate these logs:

Code:
/usr/local/apache/logs/suexec_log
      /usr/local/apache/logs/ssl_engine_log
      /usr/local/apache/logs/access_log
      /usr/local/apache/logs/error_log
      /usr/local/apache/logs/mod_jk.log
      /usr/local/apache/logs/referer_log
      /usr/local/apache/logs/agent_log
      /usr/local/apache/logs/ssl_log
      /usr/local/apache/logs/suphp_log
      /etc/httpd/logs/error_log
 

sehh

Well-Known Member
Feb 11, 2006
579
5
168
Europe
Its not rotated here, i opened a bug report in bugzilla many months ago.

I added my own lines in logrotate and had it rotated by myself in the end.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,214
13
313
Houston, TX
cPanel Access Level
Root Administrator
Its not rotated here, i opened a bug report in bugzilla many months ago.

I added my own lines in logrotate and had it rotated by myself in the end.
Note that the log rotation functionalities were improved a few weeks ago in EDGE. If you are running STABLE, it is likely these changes have not yet propagated to your build.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
Its not rotated here, i opened a bug report in bugzilla many months ago.

I added my own lines in logrotate and had it rotated by myself in the end.
The logs were added somewhat recently. If you were running the non-EA3 Stable (or still are), then cpanellogd will not rotate them.
 

ChrisHardie

Registered
May 14, 2007
4
0
151
Manual workaround for now

We had this same issue with the suexec_log and with access_log and error_log under WHM 11.11.0 cPanel 11.15.0-R17665, causing our /usr partition to fill up faster than it should. As a manual workaround until cpanel starts doing the rotating for us, we run this script every night from cron:

Code:
#!/bin/sh
#
# cPanel doesn't rotate these at all or as quickly as it should.  This is a temporary solution.

access_log=access_log
error_log=error_log
suexec_log=suexec_log

src_dir=/usr/local/apache/logs
dest_dir=/home/backups/rotated-logs

# Rotate access log
cat $dest_dir/$access_log.2 > $dest_dir/$access_log.3
cat $dest_dir/$access_log.1 > $dest_dir/$access_log.2
cat $dest_dir/$access_log.0 > $dest_dir/$access_log.1
cat $src_dir/$access_log > $dest_dir/$access_log.0
cat < /dev/null > $src_dir/$access_log

# Rotate error log
cat $dest_dir/$error_log.2 > $dest_dir/$error_log.3
cat $dest_dir/$error_log.1 > $dest_dir/$error_log.2
cat $dest_dir/$error_log.0 > $dest_dir/$error_log.1
cat $src_dir/$error_log > $dest_dir/$error_log.0
cat < /dev/null > $src_dir/$error_log

# Rotate suexec log
cat $dest_dir/$suexec_log.2 > $dest_dir/$suexec_log.3
cat $dest_dir/$suexec_log.1 > $dest_dir/$suexec_log.2
cat $dest_dir/$suexec_log.0 > $dest_dir/$suexec_log.1
cat $src_dir/$suexec_log > $dest_dir/$suexec_log.0
cat < /dev/null > $src_dir/$suexec_log

# done.
I know there are ways to do this via newsyslog, but I didn't want to mess with the cpanel magic and the possibility of having to restart a process that wasn't expecting to be restarted by newsyslog, etc.

Use at your own risk - I make no warranties - and make sure you tweak the "dest_dir" variable if you do use it. I hope that's helpful.

Chris
 

manokiss

Well-Known Member
Mar 31, 2002
576
1
318
Hi Dave,

Wondering if this was fixed already on:

WHM 11.23.2 cPanel 11.23.3-R25623

I see many of those logs are not rotating, for example i have:

-rw-r--r-- 1 root root 260731125 Jul 2 15:44 error_log

It has been configured to rotate after xxMb in the files size or something?

Thanx!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,214
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hi Dave,

Wondering if this was fixed already on:

WHM 11.23.2 cPanel 11.23.3-R25623

I see many of those logs are not rotating, for example i have:

-rw-r--r-- 1 root root 260731125 Jul 2 15:44 error_log

It has been configured to rotate after xxMb in the files size or something?

Thanx!
I made that post in 2007. So yes, those changes have been propagated by now :).

I recommend you have our technical analysts take a look at your server to determine the cause of this behavior: http://tickets.cpanel.net/submit