|
71 | 71 | use OCP\IConfig; |
72 | 72 | use OCP\Lock\ILockingProvider; |
73 | 73 | use OCP\Lock\LockedException; |
| 74 | +use OCP\Server; |
74 | 75 | use Psr\Log\LoggerInterface; |
75 | 76 |
|
76 | 77 | class Trashbin { |
@@ -903,7 +904,13 @@ protected static function deleteFiles(array $files, string $user, int|float $ava |
903 | 904 | foreach ($files as $file) { |
904 | 905 | if ($availableSpace < 0 && $expiration->isExpired($file['mtime'], true)) { |
905 | 906 | $tmp = self::delete($file['name'], $user, $file['mtime']); |
906 | | - \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']); |
| 907 | + Server::get(LoggerInterface::class)->info( |
| 908 | + 'remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota) for user "{user}"', |
| 909 | + [ |
| 910 | + 'app' => 'files_trashbin', |
| 911 | + 'user' => $user, |
| 912 | + ] |
| 913 | + ); |
907 | 914 | $availableSpace += $tmp; |
908 | 915 | $size += $tmp; |
909 | 916 | } else { |
@@ -934,16 +941,20 @@ public static function deleteExpiredFiles($files, $user) { |
934 | 941 | $size += self::delete($filename, $user, $timestamp); |
935 | 942 | $count++; |
936 | 943 | } catch (\OCP\Files\NotPermittedException $e) { |
937 | | - \OC::$server->get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed.', |
| 944 | + Server::get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed for user "{user}"', |
938 | 945 | [ |
939 | 946 | 'exception' => $e, |
940 | 947 | 'app' => 'files_trashbin', |
| 948 | + 'user' => $user, |
941 | 949 | ] |
942 | 950 | ); |
943 | 951 | } |
944 | | - \OC::$server->get(LoggerInterface::class)->info( |
945 | | - 'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.', |
946 | | - ['app' => 'files_trashbin'] |
| 952 | + Server::get(LoggerInterface::class)->info( |
| 953 | + 'Remove "' . $filename . '" from trashbin for user "{user}" because it exceeds max retention obligation term.', |
| 954 | + [ |
| 955 | + 'app' => 'files_trashbin', |
| 956 | + 'user' => $user, |
| 957 | + ], |
947 | 958 | ); |
948 | 959 | } else { |
949 | 960 | break; |
|
0 commit comments