Cobra Forum

Plesk Panel => Plesk Service/Interface => Topic started by: mahesh on Nov 05, 2024, 05:35 AM

Title: How to manage log rotation for a domain in Plesk
Post by: mahesh on Nov 05, 2024, 05:35 AM
Question
How to manage log rotation for a domain in Plesk?

Answer
1.Log in to Plesk.

2.Go to Domains > example.com > Logs > Log Rotation.
(https://pix.cobrasoft.org/images/2024/11/05/Screenshot_2022-04-01_at_19-11-15_Logs_of_example.com_-_Plesk_Obsidian_18.0.42.png)
3.In the opened window, configure the required parameters. Once done, click OK to apply the changes.

Notes:

(https://pix.cobrasoft.org/images/2024/11/05/Screenshot_2022-04-01_at_19-15-36_Logs_of_example.com_-_Plesk_Obsidian_18.0.42.png)
Managing log rotation via a command-line interface

Connect to a Plesk server via SSH (Linux) / RDP (Windows Server) and use the Plesk utility "plesk bin site" (on Windows Server, start a command prompt as an Administrator).

Commands:



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 jdoe@example.com:

#plesk bin site --update example.com -log-rotate true -log-bysize 5M -log-max-num-files 3 -log-compress true -log-email jdoe@example.com
To disable sending email about rotated log use below command:

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