summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-29 16:08:31 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-29 16:08:31 +0200
commit99f440148f5186eeaaf9c977da915be8b9283e90 (patch)
treeb925483dbc6dc90a4bde0e3ab3a617e62696ec57 /lib/private
parent1abd4f52bb5a2300a279d8b9eb0d15d22721b575 (diff)
parent5acb38b5b324a76d757074402da69f428712efd6 (diff)
downloadnextcloud-server-99f440148f5186eeaaf9c977da915be8b9283e90.tar.gz
nextcloud-server-99f440148f5186eeaaf9c977da915be8b9283e90.zip
Merge pull request #19441 from owncloud/debug-log-mode-during-upgrade
[upgrade] switch to debug logging on upgrade
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/updater.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php
index b33180c3425..8aa8b0703d7 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -32,6 +32,7 @@
namespace OC;
+use OC\Core\Command\Log\Manage;
use OC\Hooks\BasicEmitter;
use OC_App;
use OC_Installer;
@@ -69,6 +70,14 @@ class Updater extends BasicEmitter {
/** @var bool */
private $skip3rdPartyAppsDisable;
+ private $logLevelNames = [
+ 0 => 'Debug',
+ 1 => 'Info',
+ 2 => 'Warning',
+ 3 => 'Error',
+ 4 => 'Fatal',
+ ];
+
/**
* @param HTTPHelper $httpHelper
* @param IConfig $config
@@ -177,6 +186,10 @@ class Updater extends BasicEmitter {
* @return bool true if the operation succeeded, false otherwise
*/
public function upgrade() {
+ $logLevel = $this->config->getSystemValue('loglevel', \OCP\Util::WARN);
+ $this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]);
+ $this->config->setSystemValue('loglevel', \OCP\Util::DEBUG);
+
$wasMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false);
if(!$wasMaintenanceModeEnabled) {
@@ -208,6 +221,9 @@ class Updater extends BasicEmitter {
$this->emit('\OC\Updater', 'maintenanceActive');
}
+ $this->emit('\OC\Updater', 'resetLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]);
+ $this->config->setSystemValue('loglevel', $logLevel);
+
return $success;
}