diff options
author | Louis Chemineau <louis@chmn.me> | 2025-04-07 15:39:42 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2025-04-07 15:39:42 +0200 |
commit | def8bf3102b5e7c921d5b35821963540f12fc183 (patch) | |
tree | f1437f285d55c49191bd5c3371d52ea14e130363 | |
parent | c23e4b34be92cc6c930374fc1459164851765150 (diff) | |
download | nextcloud-server-backport/51837/stable31.tar.gz nextcloud-server-backport/51837/stable31.zip |
chore(files_trashbin): Add user details in log from Trashbinbackport/51837/stable31
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 32fd81465fa..3bd5ffa0d1e 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -876,7 +876,13 @@ class Trashbin implements IEventListener { 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 { @@ -907,16 +913,20 @@ class Trashbin implements IEventListener { $size += self::delete($filename, $user, $timestamp); $count++; } catch (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; |