Skip to main content

Clearing Error Log Issue

Comments

4 comments

  • quietFinn
    You must be logged in as root if you want to delete or clear that log (or any cPanel logs).
    0
  • Alongar
    You must be logged in as root if you want to delete or clear that log (or any cPanel logs).

    It still does not work, even logged in as root.
    0
  • quietFinn
    It still does not work, even logged in as root.

    if you zero the log file you must restart the service, i.e. (if it's cPanel's log file) service cpanel restart
    0
  • cPanelLauren
    This won't work even as the root user because the cPanel error logs are set to append only: [root@server logs]# lsattr /usr/local/cpanel/logs/error_log -----a-------e-- /usr/local/cpanel/logs/error_log
    This is not the best way to clear cPanel log files, I would suggest you do the following to maintain the cPanel log files: 1. Go to WHM>>Service Configuration>>cPanel Log Rotation Configuration -> Select all logs you'd like to be rotated (in most cases this should be every log file listed) 2. Go to WHM>>Service Configuration>>Tweak Settings -> Log rotation size threshold -> Select the size which you'd like for the cPanel related log files to be rotated This will ensure that every time cPanellogd runs it will check the size of these log files to ensure they do not exceed the threshold, if/when they do they'll be rotated out to /usr/local/cpanel/logs/archive/
    and compressed
    0

Please sign in to leave a comment.