Skip to content

Commit def8bf3

Browse files
committed
chore(files_trashbin): Add user details in log from Trashbin
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent c23e4b3 commit def8bf3

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

apps/files_trashbin/lib/Trashbin.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,13 @@ protected static function deleteFiles(array $files, string $user, int|float $ava
876876
foreach ($files as $file) {
877877
if ($availableSpace < 0 && $expiration->isExpired($file['mtime'], true)) {
878878
$tmp = self::delete($file['name'], $user, $file['mtime']);
879-
\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']);
879+
Server::get(LoggerInterface::class)->info(
880+
'remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota) for user "{user}"',
881+
[
882+
'app' => 'files_trashbin',
883+
'user' => $user,
884+
]
885+
);
880886
$availableSpace += $tmp;
881887
$size += $tmp;
882888
} else {
@@ -907,16 +913,20 @@ public static function deleteExpiredFiles($files, $user) {
907913
$size += self::delete($filename, $user, $timestamp);
908914
$count++;
909915
} catch (NotPermittedException $e) {
910-
\OC::$server->get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed.',
916+
Server::get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed for user "{user}"',
911917
[
912918
'exception' => $e,
913919
'app' => 'files_trashbin',
920+
'user' => $user,
914921
]
915922
);
916923
}
917-
\OC::$server->get(LoggerInterface::class)->info(
918-
'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.',
919-
['app' => 'files_trashbin']
924+
Server::get(LoggerInterface::class)->info(
925+
'Remove "' . $filename . '" from trashbin for user "{user}" because it exceeds max retention obligation term.',
926+
[
927+
'app' => 'files_trashbin',
928+
'user' => $user,
929+
],
920930
);
921931
} else {
922932
break;

0 commit comments

Comments
 (0)