Skip to main content

Clearing cPanel log files?

Comments

5 comments

  • cPanelMichael
    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.
    0
  • Scott Galambos
    Correct, sorry. /var/log/cpanel is a symlink to /usr/local/cpanel/logs for me. so can I zero out the log files in /usr/local/cpanel/logs then?
    0
  • cPanelMichael
    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.
    0
  • Scott Galambos
    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.
    0
  • cPanelMichael
    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.
    0

Please sign in to leave a comment.