Plesk

How to enable / disable Plesk debug mode

Question

How to enable / disable debug logging in Plesk?

Answer

The debug mode can be enabled either via the Plesk Panel.ini Editor extension in Plesk or in the Plesk configuration file "panel.ini" directly on a Plesk server.

In Plesk for Linux, debug log entries are written to the Plesk logfile /var/log/plesk/panel.log. Also, when running Plesk utilities with debug mode enabled in a command-line interface, they will produce debug log entries in their output.

In Plesk for Windows Server, debug log entries are written to the Plesk logfile %plesk_dir%adminlogsphp_error.log.

Warning: Once you are done with troubleshooting, disable debug mode back. Otherwise, it may fill up disk space over time.

 

Enabling / disabling debug mode via the Plesk interface
  1. Log in to Plesk.

  2. Install the Panel.ini Editor from the Extensions menu in Plesk.

  3. Open Panel.ini Editor at Extensions > My Extensions.

  4. In Panel.ini Editor, switch to the Editor tab. If the editor is empty, do the following:

    3.1. Download the panel_ini.txt file.

    3.2. Open the downloaded file and copy its content.

    3.3. Paste the content into the editor.

  5. Edit the the content and click Save:

    • To enable debug mode, remove a semicolon ";" at the beginning of the lines highlighted on the picture.

    • To disable debug mode, put a semicolon ";" back at the beginning of the lines.

 

Enabling / disabling debug mode directly on a Linux server via SSH
  1. Connect to a Plesk server via SSH.

  2. Сheck if the "panel.ini" configuration file exists:

    # ls -l /usr/local/psa/admin/conf/panel.ini

    • If the file /usr/local/psa/admin/conf/panel.ini does not exist or is empty, create it from the sample file /usr/local/psa/admin/conf/panel.ini:

      # cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini

  3. Open the file /usr/local/psa/admin/conf/panel.ini in a text editor. In this example, we are using the vi editor and the command:

    # plesk conf panel.ini

  4. Edit the panel.ini file:

    • To enable debug mode, remove a semicolon ";" at the beginning of the bold lines shown in the example below.

    • To disable debug mode, put a semicolon ";" back at the beginning of the bold lines.

    Example of enabled debug mode:

    [debug]

    ; Enable debug mode (do not use in production environment)
    enabled = on

    [log]

    ; Log messages verbosity level (from 0 to 7)
    ; 0 - only critical errors, 7 - all including debug messages, default - 3
    filter.priority = 7

    ; Enable logging of SQL queries
    show.sql_query = on

    ; Enable logging of external utilities calls
    show.util_exec = on

    ; Enable logging of stdin and stdout for external utilities calls (do not use in production environment)
    show.util_exec_io = on

  5. Save the changes and close the file. The changes will be applied immediately, no service restart is required.

    • Example of Plesk utility output when debug mode is enabled:

      # /usr/local/psa/bin/ip_ban --update -ban_period 600 -ban_time_window 600 -max_retries 10
      DEBUG [dbquery] [0] SQL: SET sql_mode = ''
      DEBUG [dbquery…

Exit mobile version