summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-09-29 14:35:32 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-09-29 16:14:45 +0200
commit655eb4ce40c5dab4b4cce56841c4d60310b414f5 (patch)
treecbe2fa95df99fd85ef40a9f98503e93ce86764a8 /lib
parentd6994b2da67ca3234d408368c49f2ddcdb953ec5 (diff)
downloadnextcloud-server-655eb4ce40c5dab4b4cce56841c4d60310b414f5.tar.gz
nextcloud-server-655eb4ce40c5dab4b4cce56841c4d60310b414f5.zip
[upgrade] switch to debug logging on upgrade
* resets afterwards * adds output about the previous log level
Diffstat (limited to 'lib')
-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 71e9732c307..8f4b81cec65 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;
}