From 686086a9413a28b160884e134d3d65a6eefb46b4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 4 Nov 2024 16:21:49 +0100 Subject: [PATCH] CustomVarRendererHook: Log an exception's message and location fixes #1054 --- library/Icingadb/Hook/CustomVarRendererHook.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Icingadb/Hook/CustomVarRendererHook.php b/library/Icingadb/Hook/CustomVarRendererHook.php index 8dca61dca..bdd62e185 100644 --- a/library/Icingadb/Hook/CustomVarRendererHook.php +++ b/library/Icingadb/Hook/CustomVarRendererHook.php @@ -69,7 +69,8 @@ final public static function prepareForObject(Model $object): Closure $hooks[] = $hook; } } catch (Throwable $e) { - Logger::error('Failed to load hook %s:', get_class($hook), $e); + Logger::error('Failed to load hook %s: %s', get_class($hook), $e); + Logger::debug($e); } } @@ -85,7 +86,8 @@ final public static function prepareForObject(Model $object): Closure $renderedValue = $hook->renderCustomVarValue($key, $value); $group = $hook->identifyCustomVarGroup($key); } catch (Throwable $e) { - Logger::error('Failed to use hook %s:', get_class($hook), $e); + Logger::error('Failed to use hook %s: %s', get_class($hook), $e); + Logger::debug($e); continue; }