feat: log plugin runtime errors

This commit is contained in:
Marek Miklewicz
2026-06-02 22:57:23 +02:00
parent 7561077eee
commit 86eb1dddbd
8 changed files with 110 additions and 12 deletions
+4
View File
@@ -10,6 +10,9 @@ if (!defined('IN_DA_PLUGIN') || IN_DA_PLUGIN !== true) {
define('PLUGIN_ROOT', dirname(__DIR__));
define('PLUGIN_EXEC_DIR', __DIR__);
require_once PLUGIN_EXEC_DIR . '/lib/PluginLogger.php';
PluginLogger::init(PLUGIN_ROOT . '/plugin.log');
foreach ([
'Settings.php',
'BackendRuntimeConfig.php',
@@ -58,6 +61,7 @@ try {
}
$handler($ctx);
} catch (Throwable $e) {
PluginLogger::exception($e, 'BOOTSTRAP');
http_response_code(500);
header('Content-Type: text/html; charset=UTF-8');
echo '<!doctype html><html><head><meta charset="utf-8"><title>Błąd</title></head><body>';