Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to remove domain-level web server logs in Plesk?
Answer
- Log in to Plesk.
-
Go to Domains > example.com > Dashboard tab > Logs > Manage Log Files.
-
Select log files that should be deleted and click Remove.
Note: On Linux servers, log file extensions
.gz,.webstat,.processedcan be safely removed.Note: To remove non-selectable (currently used) log files, see the command-line instructions.
Linux
- Connect to your Plesk server via SSH.
-
Get the website logs structure:
# 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_logNote: Subdomain and additional domain logs are located in subfolders, e.g.
/var/www/vhosts/example.com/logs/sub.example.com. - Remove log files:
-
Log files with file extensions
.gz,.webstat,.processedcan 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
-
Windows Server
- Connect to your Plesk server via RDP.
- Open Windows Explorer and go to virtual hosts directory (
%plesk_vhosts%) > example.com > logs > iis > W3xxxx. -
Right-click on a log file that needs to be removed > click Delete.
If the action can't be completed because the file is open in system, follow these steps:
-
Stop Internet Information Service (IIS) service:
Warning: The hosted websites will be offline when IIS service is stopped.
C:\> iisreset /stop
-
Remove the file:
C:\> del C:\Inetpub\vhosts\example.com\logs\iis\W3SVC43\u_extend15017.log
-
Start IIS service back:
C:\> iisreset /start
-
Comments
Please sign in to leave a comment.