How to enable/disable debug logging in Plesk Onyx and earlier versions for Linux

Created:

2016-11-16 13:18:56 UTC

Modified:

2017-08-16 16:59:30 UTC

2

Was this article helpful?


Have more questions?

Submit a request

How to enable/disable debug logging in Plesk Onyx and earlier versions for Linux

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

How to enable/disable debug logging in Plesk Onyx and older version on Linux?

Resolution

  1. Connect to the server using SSH .
  2. Copy sample configuration file /usr/local/psa/admin/conf/panel.ini.sample to /usr/local/psa/admin/conf/panel.ini:

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

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

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