Articles in this section

How to enable / disable Plesk debug mode

Plesk for Windows Plesk for Linux kb: tools

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How to enable / disable debug logging in Plesk?

Answer

Note: 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.

Note: In Plesk for Linux, debug log entries are written to 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 Plesk logfile %plesk_dir%admin\logs\php_error.log.

Warning: Debug mode can consume a large amount of disk space over time. Once you are done troubleshooting, disable debug mode.

 

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, apply the following steps:

    4.1. Download the panel_ini.txt file.

    4.2. Open the downloaded file and copy its content.

    4.3. Paste the content into the editor.

  5. Edit 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.


    Screenshot_2019-01-23_Panel_ini_Editor_-_Plesk_Onyx_17_8_11.png
     

Command-line interface (Linux)
  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:

    CONFIG_TEXT: [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

    [ext-wp-toolkit]
    logSecurityCheckErrors = on
    logExceptionStackTraces = 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] [0] END: 0.00023102760314941 sec
      DEBUG [dbquery] [1] SQL: SET NAMES utf8
      DEBUG [dbquery] [1] END: 0.00013208389282227 sec
      DEBUG [dbquery] [2] SQL: connect
      DEBUG [dbquery] [2] END: 0.00038313865661621 sec
      DEBUG [dbquery] [3] SQL: SET sql_mode = ''
      DEBUG [dbquery] [3] END: 0.00014400482177734 sec
      ...
      SUCCESS: The settings were updated.

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

      # /usr/local/psa/bin/ip_ban --update -ban_period 600 -ban_time_window 600 -max_retries 10
      SUCCESS: The settings were updated.

Command-line interface (Windows Server)
  1. Connect to a Plesk server via RDP.
  2. Open the file panel.ini located in the folder %plesk_dir%admin\conf\ (Just paste this path in Windows Explorer to open) in any text editor.
    • If the panel.ini file does not exist, create it by copying the sample configuration file panel.ini.sample.
  3. 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 in the lines.

    Example of enabled debug mode:

    CONFIG_TEXT: [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

    [ext-wp-toolkit]
    logSecurityCheckErrors = on
    logExceptionStackTraces = on

  4. Save the changes and close the file. Changes will be applied immediately, no service restart is required.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.