Articles in this section

How to change log rotation settings for a domain in Plesk

Plesk for Windows kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How to change log rotation settings for a domain in Plesk?

Answer

Plesk interface
  1. Log in to Plesk.
  2. Go to Domains > example.com > Dashboard tab > Logs > Log Rotation.

     

     

  3. In the pop-up window, configure the required parameters. Once done, click OK to apply the changes.

    Notes:

    • When Log rotation is disabled, each logfile will be stored on the system permanently.
    • When the Maximum number of log files is set to 0, all existing logfiles will be deleted after log rotation condition.
    • ModSecurity logfiles are rotated by size only.

     

     

Command-line interface

 

Connect to your Plesk server via SSH (Linux) / RDP (Windows Server) and use the Plesk utility plesk bin site.

Note: On Windows Server, start a command prompt as an Administrator.

Commands:

  • -log-rotate <true|false> - Log rotation status (default: true)
  • -log-bysize <number>[B|K|M|G] - Enables log rotation by size
  • -log-bytime <daily|weekly|monthly> - Enables log rotation by time (default: daily)
  • -log-max-num-files <number> - Maximum number of log files to store
  • -log-compress <true|false> - Log files compression (default: true)
  • -log-email <email> - send logfiles to an email after rotation

 

Example:

The following command enables log rotation; sets Log rotation condition to 5 MB, Maximum number of log files to 3 days; enables log compression and will send an email with logfiles to john_doe@example.com:

# plesk bin site --update example.com -log-rotate true -log-bysize 5M -log-max-num-files 3 -log-compress true -log-email john_doe@example.com

To disable sending email about rotated log use below command:

# plesk bin site --update example.com -log-email ""

 

Additional Information

To change log rotation settings for all domains on a server, visit this KB article.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.