mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 21:04:25 +02:00
Logger: Fix substitution of exception messages
This commit is contained in:
parent
f93c2de6be
commit
0a387573f3
@ -243,7 +243,9 @@ class Logger
|
|||||||
return vsprintf(
|
return vsprintf(
|
||||||
array_shift($arguments),
|
array_shift($arguments),
|
||||||
array_map(
|
array_map(
|
||||||
function ($a) { return is_string($a) ? $a : json_encode($a); },
|
function ($a) {
|
||||||
|
return is_string($a) ? $a : ($a instanceof Exception ? $a->getMessage() : json_encode($a));
|
||||||
|
},
|
||||||
$arguments
|
$arguments
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -56,7 +56,7 @@ class Manager
|
|||||||
} catch (NotReadableError $e) {
|
} catch (NotReadableError $e) {
|
||||||
Logger::error(
|
Logger::error(
|
||||||
new IcingaException(
|
new IcingaException(
|
||||||
'Cannot load preferences for user "%s". An exception was thrown',
|
'Cannot load preferences for user "%s". An exception was thrown: %s',
|
||||||
$username,
|
$username,
|
||||||
$e
|
$e
|
||||||
)
|
)
|
||||||
@ -74,7 +74,7 @@ class Manager
|
|||||||
} catch (NotReadableError $e) {
|
} catch (NotReadableError $e) {
|
||||||
Logger::error(
|
Logger::error(
|
||||||
new IcingaException(
|
new IcingaException(
|
||||||
'Cannot load preferences for user "%s". An exception was thrown',
|
'Cannot load preferences for user "%s". An exception was thrown: %s',
|
||||||
$username,
|
$username,
|
||||||
$e
|
$e
|
||||||
)
|
)
|
||||||
@ -92,7 +92,7 @@ class Manager
|
|||||||
$groupsFromBackend = $groupBackend->getMemberships($user);
|
$groupsFromBackend = $groupBackend->getMemberships($user);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Logger::error(
|
Logger::error(
|
||||||
'Can\'t get group memberships for user \'%s\' from backend \'%s\'. An exception was thrown:',
|
'Can\'t get group memberships for user \'%s\' from backend \'%s\'. An exception was thrown: %s',
|
||||||
$username,
|
$username,
|
||||||
$name,
|
$name,
|
||||||
$e
|
$e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user