Site domlogs will not rotate

Operating System & Version
CentOS v7.9.2009 STANDARD standard
cPanel & WHM Version
106.0.4

celiac101

Well-Known Member
Dec 19, 2012
127
5
68
cPanel Access Level
Website Owner
I am having issue where the individual site domlogs will not auto rotate, which are located in:
/usr/local/apache/domlogs/

I've checked all the various settings that I can think of, and all log rotation settings seem to be set correctly, however they will not rotate.

Any help with resolving this would be highly appreciated...thank you!
 

cPanelWilliam

Administrator
Staff member
Mar 13, 2018
108
17
93
Houston
cPanel Access Level
Root Administrator
Hi!

The main setting you can enable/disable to control domlog rotation would be in WHM > Tweak Settings > Stats and Logs > "Delete each domain’s access logs after statistics are gathered". If this setting is turned off, the domlogs would just grow forever until something else that isn't WHM/cPanel rotates them.

Since the domlog rotation is done by the cPanel Statistics system, you can check the stats_log ( /usr/local/cpanel/logs/stats_log ) or WHM > Statistics Software Configuration to see if the server is having issues with processing statistics, which would impact the domain logs. If you need additional control of this, I would recommend configuring logrotate to rotate the domlogs:

How to modify logrotate configurations
 

celiac101

Well-Known Member
Dec 19, 2012
127
5
68
cPanel Access Level
Website Owner
Thank you for the reply.

This is ON: WHM > Tweak Settings > Stats and Logs > "Delete each domain’s access logs after statistics are gathered"

Under WHM > Statistics Software Configuration the log rogations is set to the defaults, however I have unchecked all of these to speed up the server (doesn't everyone use Google Analytics now to track this stuff?):

Generators Configuration
  • Analog - OFF
  • Awstats - OFF
  • Webalizer - OFF
Will the logs not rotate at all if I don't have one of these turned on?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,667
1,853
363
cPanel Access Level
Root Administrator
Even with those set to "off" i would still expect the rotation to happen. The process will just run and then note that no logging software is enabled, and then moves on with the rotation.

It might be best to create a ticket for this issue so we can see the problem in action on your machine.
 

celiac101

Well-Known Member
Dec 19, 2012
127
5
68
cPanel Access Level
Website Owner
So I tried turning on Awstats and it still would not rotate any user logs. I finally found an old post here that told me I needed to create this file:
/etc/logrotate.d/apache

with this content
/usr/local/apache/domlogs/mysite.com-ssl_log {
rotate 9
daily
compress
}

and finally the site log is rotating. I don't know if I will create a ticket at this point, but it does seem like something isn't right in WHM if you can't make this happen without doing what I had to do.