From cf8be87e47ce2e63c87f5a7bd6dc93b1cd6b6838 Mon Sep 17 00:00:00 2001
From: Morris Jobke <hey@morrisjobke.de>
Date: Thu, 25 Mar 2021 16:14:20 +0100
Subject: [PATCH] Log when a storage is marked as unavailable

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
---
 lib/private/Files/Cache/Storage.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php
index 74f5df2a5b1..9f28926aec5 100644
--- a/lib/private/Files/Cache/Storage.php
+++ b/lib/private/Files/Cache/Storage.php
@@ -30,6 +30,7 @@
 namespace OC\Files\Cache;
 
 use OCP\Files\Storage\IStorage;
+use Psr\Log\LoggerInterface;
 
 /**
  * Handle the mapping between the string and numeric storage ids
@@ -175,6 +176,9 @@ class Storage {
 	 */
 	public function setAvailability($isAvailable, int $delay = 0) {
 		$available = $isAvailable ? 1 : 0;
+		if (!$isAvailable) {
+			\OC::$server->get(LoggerInterface::class)->info('Storage with ' . $this->storageId . ' marked as unavailable', ['app' => 'lib']);
+		}
 
 		$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
 		$query->update('storages')
-- 
GitLab