diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2020-01-28 13:00:13 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2020-01-28 13:00:13 +0100 |
commit | e00844488709552febdc07c19bed4c7ceb52a98d (patch) | |
tree | 44812e00bc9061fca2c2393b17982bdce3cf6f71 /lib/private/Log | |
parent | 46aaeb45612e20b6f460396533faf7f26ed1d6f7 (diff) | |
download | nextcloud-server-e00844488709552febdc07c19bed4c7ceb52a98d.tar.gz nextcloud-server-e00844488709552febdc07c19bed4c7ceb52a98d.zip |
always require a message paramter for data logging
also ensure it plays well with current log reader
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Log')
-rw-r--r-- | lib/private/Log/LogDetails.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php index 2eea17ad73d..b1dc6e4311b 100644 --- a/lib/private/Log/LogDetails.php +++ b/lib/private/Log/LogDetails.php @@ -80,6 +80,16 @@ abstract class LogDetails { 'userAgent', 'version' ); + + if(is_array($message) && !array_key_exists('Exception', $message)) { + // Exception messages should stay as they are, + // anything else modern is split to 'message' (string) and + // data (array) fields + $shortMessage = $message['message'] ?? '(no message provided)'; + $entry['data'] = $message; + $entry['message'] = $shortMessage; + } + return $entry; } |