Log Rotation

Valid for versions 82 through the latest version


Last modified: November 30, 2022

Overview

Note:

This document discusses using Apaches Log Rotation interface (Home » Service Configuration » Apache Configuration » Log Rotation) to manage the rotation and archiving of Apache log files.

For information about managing the rotation and archiving of WHM & cPanel log files, read our cPanel Log Rotation Configuration interface (Home » Service Configuration » cPanel Log Rotation Configuration) documentation.

This interface allows you to select Apache log files for the cpanellogd daemon to compress and archive. The cpanellogd daemon compresses the selected log files into a single file for each type.

Archiving happens either when the log file grows larger than the log rotation size threshold or at the end of the month. The default log rotation size threshold is 300 MB. You can change it in the Stats and Logs section of WHMs Tweak Settings interface (WHM » Home » Server Configuration » Tweak Settings).

The system stores the compressed files in the /home/username/logs directory, where username represents the name of the cPanel account. If you disable the Archive logs in the users home directory at the end of each stats run unless configured by the user option in the Stats and Logs section of WHMs Tweak Settings interface (WHM » Home » Server Configuration » Tweak Settings), the system will not store logs in each users directory.

Important:

The system does not automatically delete the compressed log files. You must manually delete any unnecessary files.

Configure log files

To select the log files that the cpanellogd daemon will archive, perform the following steps:

  1. Select the appropriate checkboxes next to the log files that you wish to archive.
    • error_log  This log file contains errors that Apache encounters when it tries to process a request.
    • access_log  This log file contains all requests that Apache processes.
    • modsec_debug_log  This log file contains errors that ModSecurity® encounters when it tries to block a request.
    • suexec_log  This file contains information about suEXEC audit logs. This is useful, for example, to diagnose internal server errors that do not produce relevant information in the error log.
  2. Click Save.
Note:

For more information about log files that appear in this interface, read our The cPanel & WHM Log Files documentation.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Apache Configuration

Valid for versions 82 through the latest version Last modified: September 29, 2020...

cPanel Log Rotation Configuration

Valid for versions 82 through the latest version Last modified: May 6, 2021 Overview...

cPanel Web Disk Configuration

Valid for versions 88 through the latest version Last modified: August 9, 2022...

cPanel Web Services Configuration

Valid for versions 88 through the latest version Last modified: August 9, 2022...

DirectoryIndex Priority

Valid for versions 82 through the latest version Last modified: November 30, 2022...