Applicable to:
- Plesk for Linux
- Plesk for Windows
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%admin\logs\php_error.log
.
Warning: Once you are done with troubleshooting, disable debug mode back. Otherwise, it may fill up disk space over time.
-
Install the Panel.ini Editor from the Extensions menu in Plesk.
-
Open Panel.ini Editor at Extensions > My Extensions.
-
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.
-
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.
-
-
Connect to a Plesk server via SSH.
-
С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
-
-
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
-
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 -
-
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.
-
-
Connect to a Plesk server via RDP.
-
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 filepanel.ini.sample
.
- If the
-
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 -
-
Save the changes and close the file. Changes will be applied immediately, no service restart is required.
Comments
0 comments
Please sign in to leave a comment.