Question
How to remove domain logs in Plesk?
Answer
-
Go to Domains > example.com > Logs > Manage Log Files.
-
Select log files that should be deleted and click Remove.
Note: On Linux servers, log file extensions
.gz
,.webstat
,.processed
can be safely removed.
-
Connect to a Plesk server via SSH.
-
Get the website logs structure:
Note: Subdomain and additional domain logs are located in subfolders, e.g.
/var/www/vhosts/example.com/logs/sub.example.com
.# ls -l /var/www/vhosts/example.com/logs
...
drwx------ 2 user root 4096 Dec 1 18:24 .
drwx--x--- 5 user psaserv 4096 Dec 1 17:39 ..
-rw-r--r-- 2 root root 132 Dec 1 17:39 access_log
-rw-r--r-- 2 root root 14 Dec 1 18:24 access_log.processed
-rw------- 1 root root 0 Dec 1 18:24 access_log.webstat
-rw-r--r-- 2 root root 0 Dec 1 17:39 access_ssl_log
-rw-r--r-- 2 root root 0 Dec 1 18:24 access_ssl_log.processed
-rw------- 1 root root 0 Dec 1 18:24 access_ssl_log.webstat
-rw-r--r-- 2 root root 1278 Dec 1 18:28 error_log
-rw-r--r-- 2 root root 16 Dec 1 18:28 error_log.gz
-rw-r--r-- 2 root root 0 Dec 1 17:39 proxy_access_log
-rw-r--r-- 2 root root 0 Dec 1 17:39 proxy_access_ssl_log
-rw-r--r-- 2 root root 0 Dec 1 17:39 proxy_error_log -
Remove log files:
-
Log files with file extensions
.gz
,.webstat
,.processed
can be safely removed:# rm -rf /var/www/vhosts/example.com/logs/error_log.gz
-
Main website log files (access_log, error_log, access_ssl_log) must be cleared:
Warning: Removing main log files instead of clearing them will lead to incorrect functionality of Apache and nginx.
# cat /dev/null >/var/www/vhosts/example.com/logs/error_log
-