v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
LogManager
Logs

Save cPanel account's log archive settings

This function saves the account's log archive settings.

Note:

You must pass at least one of the archive_logs, prune_archive, or retention_days parameters.

get/LogManager/set_settings

Query parameters

archive_logs0 | 1
Example:1

Whether to archive log files to your home directory after the system processes statistics.

  • 1 — Archive the logs.
  • 0 — Do not archive the logs.

Note:

  • This parameter defaults to the archive-logs setting's value in the user's ~/.cpanel-logs file.
  • If this file does not exist, this parameter defaults to the default_archive-logs key's value in the cpanel.config file.
prune_archive0 | 1
Example:1

Whether to remove the previous month's archived logs from the ~/logs directory at the end of each month.

  • 1 — Remove the logs.
  • 0 — Do not remove the logs.

Note:

  • This parameter defaults to the remove-old-archived-logs setting's value in the user's ~/.cpanel-logs file.
  • If this file doesn't exist, this parameter defaults to the default_remove-old-archive-logs key's value in the cpanel.config file.
retention_daysinteger
Example:30

The number of days to retain archived log files before automatic removal.

  • 0 — Retain logs indefinitely.
  • -1 — Clear the per-user override and revert to the server default.
  • Any positive integer — Retain logs for that many days.

When not provided, the existing value is preserved.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "set_settings",
  "module": "LogManager",
  "result": {
    "status": 1
  }
}