Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore(files_trashbin): Add user details in log from Trashbin
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Apr 7, 2025
commit fb361c3611cb611693f03a24ff2ce1fc6d4af236
20 changes: 15 additions & 5 deletions apps/files_trashbin/lib/Trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,13 @@ protected static function deleteFiles(array $files, string $user, int|float $ava
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 {
Expand Down Expand Up @@ -900,16 +906,20 @@ public static function deleteExpiredFiles($files, $user) {
$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;
Expand Down
Loading