aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Log
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2022-05-02 17:49:32 +0200
committerThomas Citharel <tcit@tcit.fr>2022-05-02 19:29:35 +0200
commit1e7d924c61f312364827af1014e765d98e71ac05 (patch)
tree1549d0fe92e7bba7dfb700b82797ac355bff7b7f /lib/private/Log
parent3197ae83a4e85b1d26c8df7e5af04d50e89bd539 (diff)
downloadnextcloud-server-1e7d924c61f312364827af1014e765d98e71ac05.tar.gz
nextcloud-server-1e7d924c61f312364827af1014e765d98e71ac05.zip
Fix logging data context to file
It was only logged when an exception was provided or when using logData (which is not being much used). We make sure the interpolated parameters are not logged. Only tested with file write logger, but shouldn't work differently. Crash reporters always had the context. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'lib/private/Log')
-rw-r--r--lib/private/Log/LogDetails.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php
index 3353ea3f4cc..b3544572708 100644
--- a/lib/private/Log/LogDetails.php
+++ b/lib/private/Log/LogDetails.php
@@ -5,6 +5,7 @@
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Julius Härtl <jus@bitgrid.net>
+ * @author Thomas Citharel <nextcloud@tcit.fr>
*
* @license GNU AGPL version 3 or any later version
*
@@ -90,8 +91,9 @@ abstract class LogDetails {
$entry['exception'] = $message;
$entry['message'] = $message['CustomMessage'] !== '--' ? $message['CustomMessage'] : $message['Message'];
} else {
- $entry['data'] = $message;
$entry['message'] = $message['message'] ?? '(no message provided)';
+ unset($message['message']);
+ $entry['data'] = $message;
}
}