diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-06-10 07:35:51 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-06-10 07:35:51 +0200 |
commit | e536b7bbcc8a80a62592112a2214d61c2501e0c5 (patch) | |
tree | 62c71b83064a5028027773d9aaaded3d283df63e /lib | |
parent | ae4907b6c95b7ac5d36ef358048c7acafd517c07 (diff) | |
download | nextcloud-server-e536b7bbcc8a80a62592112a2214d61c2501e0c5.tar.gz nextcloud-server-e536b7bbcc8a80a62592112a2214d61c2501e0c5.zip |
Move exception logging to separate field
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Log/LogDetails.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php index 7674837e28c..5ca8231eecb 100644 --- a/lib/private/Log/LogDetails.php +++ b/lib/private/Log/LogDetails.php @@ -82,13 +82,17 @@ abstract class LogDetails { 'version' ); - if (is_array($message) && !array_key_exists('Exception', $message)) { - // Exception messages should stay as they are, + if (is_array($message)) { + // Exception messages are extracted and the exception is put into a separate field // anything else modern is split to 'message' (string) and // data (array) fields - $shortMessage = $message['message'] ?? '(no message provided)'; - $entry['data'] = $message; - $entry['message'] = $shortMessage; + if (array_key_exists('Exception', $message)) { + $entry['exception'] = $message; + $entry['message'] = $message['CustomMessage'] !== '--' ? $message['CustomMessage'] : $message['Message']; + } else { + $entry['data'] = $message; + $entry['message'] = $message['message'] ?? '(no message provided)'; + } } return $entry; |