diff options
author | Louis Chemineau <louis@chmn.me> | 2025-04-08 10:30:07 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2025-04-08 10:30:07 +0200 |
commit | f543aef7abf0db9d30367edef40db1a91bb666b0 (patch) | |
tree | ef1df6dbf2e5ead9b4d3548605aa9c98c88a38cb | |
parent | f50426b014c3b13f7050242469fc158000b6fd56 (diff) | |
download | nextcloud-server-backport/51837/stable29.tar.gz nextcloud-server-backport/51837/stable29.zip |
chore(files_trashbin): Add user details in log from Trashbinbackport/51837/stable29
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 1d29ce2aa60..434cfd8e002 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -71,6 +71,7 @@ use OCP\FilesMetadata\IFilesMetadataManager; use OCP\IConfig; use OCP\Lock\ILockingProvider; use OCP\Lock\LockedException; +use OCP\Server; use Psr\Log\LoggerInterface; class Trashbin { @@ -903,7 +904,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 { @@ -934,16 +941,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; |