Scott Galambos

Well-Known Member
Jul 13, 2016
125
8
68
Canada
cPanel Access Level
Root Administrator
my cpanel logs in /var/log/cpanel take up 400MB now. can I reset these somehow? like a cp /dev/null error_log or access_log? thats ok? spamd_error_log is big too. I just don't want to zero them if there are processes that are reading stuff from them or something.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
my cpanel logs in /var/log/cpanel
Hello,

Could you verify which particular log files exist in that directory? Are you sure the logs in-question are not located in the /usr/local/cpanel/logs/ directory?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

You can enable rotation for the log files in that directory using "WHM Home » Service Configuration » cPanel Log Rotation Configuration". Note the following quote from this interface as well:

Files from /usr/local/cpanel/logs selected below will be rotated based upon their size. The rotated files will be compressed and stored in /usr/local/cpanel/logs/archive/. The files are named to include the month in which they are rotated. Consequently, the file names do not relate in any way to the content of the file being rotated. Files are only rotated when they grow larger than the WHM >> Tweak Settings >> Log Rotation Size Threshold or the default of 300MB. The archived log files are left in place indefinitely. Files not chosen here will not ever be rotated by cPanel software.
Thank you.
 

Scott Galambos

Well-Known Member
Jul 13, 2016
125
8
68
Canada
cPanel Access Level
Root Administrator
I went to my "cPanel Log Rotation Configuration" and I have them mostly all checked on. But I don't have a /usr/local/cpanel/logs/archive directory yet. this would be because each individual log file has not exceeded 300MB yet correct? My tweak setting is 300MB.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
But I don't have a /usr/local/cpanel/logs/archive directory yet. this would be because each individual log file has not exceeded 300MB yet correct? My tweak setting is 300MB.
That's correct. You can lower the threshold if you'd like the logs to rotate before they reach 300MB.

Thank you.