feat: log plugin runtime errors
This commit is contained in:
@@ -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>';
|
||||
|
||||
Reference in New Issue
Block a user