diff options
author | Louis Chemineau <louis@chmn.me> | 2025-04-07 15:39:45 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2025-04-07 15:39:45 +0200 |
commit | fb361c3611cb611693f03a24ff2ce1fc6d4af236 (patch) | |
tree | a35eefa5744951fbf7220668eaf6dc0d7ce8e62f | |
parent | 1059a6a8f33ccafc6806dca132c46765e09c872b (diff) | |
download | nextcloud-server-backport/51837/stable30.tar.gz nextcloud-server-backport/51837/stable30.zip |
chore(files_trashbin): Add user details in log from Trashbinbackport/51837/stable30
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index fe16a3a9d69..087811c5766 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -869,7 +869,13 @@ class Trashbin { foreach ($files as $file) { if ($availableSpace < 0 && $expiration->isExpired($file['mtime'], true)) { $tmp = self::delete($file['name'], $user, $file['mtime']); - \OC::$server->get(LoggerInterface::class)->info('remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota)', ['app' => 'files_trashbin']); + Server::get(LoggerInterface::class)->info( + 'remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota) for user "{user}"', + [ + 'app' => 'files_trashbin', + 'user' => $user, + ] + ); $availableSpace += $tmp; $size += $tmp; } else { @@ -900,16 +906,20 @@ class Trashbin { $size += self::delete($filename, $user, $timestamp); $count++; } catch (\OCP\Files\NotPermittedException $e) { - \OC::$server->get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed.', + Server::get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed for user "{user}"', [ 'exception' => $e, 'app' => 'files_trashbin', + 'user' => $user, ] ); } - \OC::$server->get(LoggerInterface::class)->info( - 'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.', - ['app' => 'files_trashbin'] + Server::get(LoggerInterface::class)->info( + 'Remove "' . $filename . '" from trashbin for user "{user}" because it exceeds max retention obligation term.', + [ + 'app' => 'files_trashbin', + 'user' => $user, + ], ); } else { break; |