Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Clearing cPanel log files?

Discussion in 'General Discussion' started by SCott Galambos, Sep 20, 2017.

  1. Scott Galambos

    Joined:
    Jul 13, 2016
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Scott Galambos

    Joined:
    Jul 13, 2016
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    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?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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:

    Thank you.
     
  5. Scott Galambos

    Joined:
    Jul 13, 2016
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    That's correct. You can lower the threshold if you'd like the logs to rotate before they reach 300MB.

    Thank you.
     
Loading...

Share This Page