How to enable/disable debug logging in Plesk 11.5 and higher for Linux

Created:

2016-11-16 13:18:56 UTC

Modified:

2017-04-06 16:58:16 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to enable/disable debug logging in Plesk 11.5 and higher for Linux

Symptoms

How do I enable/disable debug logging in Plesk 11.5 and up under Linux?

Resolution

  1. Copy sample configuration file /usr/local/psa/admin/conf/panel.ini.sample to /usr/local/psa/admin/conf/panel.ini , unless panel.ini already exists there:

    # ll /usr/local/psa/admin/conf/ | grep panel
    -rw-r--r-- 1 root root 317 Feb 6 11:39 panel.ini
    -rw-r--r-- 1 root root 198 Oct 15 16:01 panel.ini.original
    -rw-r--r-- 1 root root 1542 Dec 10 17:06 panel.ini.sample
  2. To enable debug logging, uncomment (remove ; semicolon in the beginning of the string) the following lines in panel.ini :

    [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
  3. To disable debug logging, comment out the above lines in panel.ini .

  4. Log with enabled debug mode can be found in /usr/local/psa/admin/logs/panel.log file.

Example of the debug 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 the debug disabled:

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

NOTE : Changes take effect immediately (e.g. there is no need for service psa restart or other such commands), because small binaries like ip_ban read those settings each time they are started.

Also, there are other options that allow to hide some of the log messages. Among them are:

    ; 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

Additional Information

#213377849 - How to enable/disable debug logging in Plesk 11.5 and higher for Windows

Have more questions? Submit a request
Please sign in to leave a comment.