Skip to Content
PluginsDevKitDebug Bar

Debug Bar

PHP Debug Bar (php-debugbar/php-debugbar  v3.7). Shows at bottom of every page.

Collectors

TabData
PHPPHP version, extensions
MessagesCustom log messages
Request$_GET, $_POST, $_SERVER, $_COOKIE, $_SESSION
TimelineExecution time measurements
MemoryMemory usage stats
ExceptionsCaught exceptions + PHP errors
Config$CFG (secrets/passwords excluded)
MoodleMoodle version, PHP version, debug mode, language
String Managerget_string() calls (only when custom string manager enabled)
DatabaseSQL query log (if enabled in settings)

Logging

\local_devkit\local\debugbar::log('message'); \local_devkit\local\debugbar::log('error happened', \local_devkit\local\log_level::ERROR);

Levels: alert, critical, debug, emergency, error, info, notice, success, warning.

Measuring

$result = \local_devkit\local\debugbar::measure('slow operation', function () { // Do stuff. return $output; });

Shows in Timeline + Messages tabs.

Exceptions

try { // Risky code. } catch (\Throwable $e) { \local_devkit\local\debugbar::log_exception($e); }

Also auto-catches all PHP errors/exceptions via custom handlers.

File paths in debug bar are clickable. Choose editor in settings.

23 editors: sublime, textmate, emacs, macvim, codelite, phpstorm, phpstorm-remote, idea, idea-remote, vscode, vscode-insiders, vscode-remote, vscode-insiders-remote, vscodium, nova, xdebug, atom, espresso, netbeans, cursor, cursor-remote, windsurf, zed, antigravity.

Redirect Stacking

Debug data persists across redirects via SQLite at $CFG->tempdir/local_devkit/debugbar.sqlite. Prunes to 1 dataset.

URL: /local/devkit/debugbar/open.php (requires login).

AJAX

Debug bar binds to fetch and XHR requests. Shows AJAX debug tab.

See Configuration for AJAX setup.