mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Move exception logging to separate field
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
ae4907b6c9
commit
e536b7bbcc
1 changed files with 9 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue