aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2025-05-20 16:14:12 +0200
committerBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2025-05-20 16:14:12 +0200
commitc909f0125f7842033e88c721c191a06d3f910a5e (patch)
tree96ac145f7c966180189dee0015a2ed8a360c5622
parentc62fa55007a750236e6520893a02b4b10b406d62 (diff)
downloadnextcloud-server-feat/add_log_scan_command.tar.gz
nextcloud-server-feat/add_log_scan_command.zip
feat(scan): add log for failed files scanfeat/add_log_scan_command
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
-rw-r--r--apps/files/lib/Command/Scan.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php
index 7f45a9ea518..146d7a3d2c8 100644
--- a/apps/files/lib/Command/Scan.php
+++ b/apps/files/lib/Command/Scan.php
@@ -166,6 +166,10 @@ class Scan extends Base {
} catch (NotFoundException $e) {
$output->writeln('<error>Path not found: ' . $e->getMessage() . '</error>');
++$this->errorsCounter;
+ $this->logger->error(
+ 'Path not found: ' . $e->getMessage(),
+ [ 'exception' => $e ],
+ );
} catch (LockedException $e) {
if (str_starts_with($e->getPath(), 'scanner::')) {
$output->writeln('<error>Another process is already scanning \'' . substr($e->getPath(), strlen('scanner::')) . '\'</error>');
@@ -176,6 +180,10 @@ class Scan extends Base {
$output->writeln('<error>Exception during scan: ' . $e->getMessage() . '</error>');
$output->writeln('<error>' . $e->getTraceAsString() . '</error>');
++$this->errorsCounter;
+ $this->logger->error(
+ 'Exception during scan: ' . $e->getMessage(),
+ [ 'exception' => $e ],
+ );
}
}