Articles in this section

How to remove domain-level web server logs in Plesk

Plesk for Windows kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How to remove domain-level web server logs in Plesk?

Answer

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


    Screenshot_2020-07-15_Logs_of_example_com_-_Plesk_Obsidian_18_0_27.png
     

  3. Select log files that should be deleted and click Remove.

    Note: On Linux servers, log file extensions .gz, .webstat, .processed can be safely removed.

    Note: To remove non-selectable (currently used) log files, see the command-line instructions.


    Screenshot_2020-07-15_Manage_Log_Files_of_example_com_-_Plesk_Obsidian_18_0_27_3_.png
     

Command-line interface

 

Linux

  1. Connect to your Plesk server via SSH.
  2. 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_log

    Note: Subdomain and additional domain logs are located in subfolders, e.g. /var/www/vhosts/example.com/logs/sub.example.com.

  3. 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

 

 

Windows Server

  1. Connect to your Plesk server via RDP.
  2. Open Windows Explorer and go to virtual hosts directory (%plesk_vhosts%) > example.com > logs > iis > W3xxxx.
  3. 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:

    1. Stop Internet Information Service (IIS) service:

      Warning: The hosted websites will be offline when IIS service is stopped.

      C:\> iisreset /stop

    2. Remove the file:

      C:\> del C:\Inetpub\vhosts\example.com\logs\iis\W3SVC43\u_extend15017.log

    3. Start IIS service back:

      C:\> iisreset /start

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.