diff options
author | Thomas Pulzer <t.pulzer@kniel.de> | 2016-07-22 11:44:19 +0200 |
---|---|---|
committer | Thomas Pulzer <t.pulzer@kniel.de> | 2016-07-22 11:44:19 +0200 |
commit | ba3f4f118e8c48a23dcffa723e38439f0b9b7df9 (patch) | |
tree | 40cf7127d4bb63f362a37185820eee50fd849ce8 /core/Command | |
parent | 4b4990c48fd4c6841bde260b2b2e1bc665b46e1c (diff) | |
download | nextcloud-server-ba3f4f118e8c48a23dcffa723e38439f0b9b7df9.tar.gz nextcloud-server-ba3f4f118e8c48a23dcffa723e38439f0b9b7df9.zip |
Changed logtype to file instead of owncloud.
- Updated the config sample to point to log_type='file'
- Renamed the Class for logfile logging to File in namespace 'OC\Log\'.
Changed the occurrences of 'OC\Log\Owncloud' to 'OC\Log\File'.
- Renamed the Class for log:file command to File in namespace 'OC\Core\Command\Log\File'.
Changed registration of the command to use 'OC\Core\Command\Log\File'.
- Changed default Syslog tag to Nextcloud
- Retained backwards compatibility for configs with 'logtype' => 'owncloud'
- Adjusted tests for the new file log.
Closes #490.
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Log/File.php (renamed from core/Command/Log/OwnCloud.php) | 14 | ||||
-rw-r--r-- | core/Command/Log/Manage.php | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/core/Command/Log/OwnCloud.php b/core/Command/Log/File.php index 391259f76b8..ec490237400 100644 --- a/core/Command/Log/OwnCloud.php +++ b/core/Command/Log/File.php @@ -31,7 +31,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class OwnCloud extends Command { +class File extends Command { /** @var IConfig */ protected $config; @@ -43,8 +43,8 @@ class OwnCloud extends Command { protected function configure() { $this - ->setName('log:owncloud') - ->setDescription('manipulate ownCloud logging backend') + ->setName('log:file') + ->setDescription('manipulate logging backend') ->addOption( 'enable', null, @@ -70,7 +70,7 @@ class OwnCloud extends Command { $toBeSet = []; if ($input->getOption('enable')) { - $toBeSet['log_type'] = 'owncloud'; + $toBeSet['log_type'] = 'file'; } if ($file = $input->getOption('file')) { @@ -89,12 +89,14 @@ class OwnCloud extends Command { } // display config - if ($this->config->getSystemValue('log_type', 'owncloud') === 'owncloud') { + // TODO: Drop backwards compatibility for config in the future + $logType = $this->config->getSystemValue('log_type', 'file'); + if ($logType === 'file' || $logType === 'owncloud') { $enabledText = 'enabled'; } else { $enabledText = 'disabled'; } - $output->writeln('Log backend ownCloud: '.$enabledText); + $output->writeln('Log backend file: '.$enabledText); $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); $defaultLogFile = rtrim($dataDir, '/').'/nextcloud.log'; diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php index 14d41170dca..554708dfa42 100644 --- a/core/Command/Log/Manage.php +++ b/core/Command/Log/Manage.php @@ -34,7 +34,7 @@ use Symfony\Component\Console\Output\OutputInterface; class Manage extends Command { - const DEFAULT_BACKEND = 'owncloud'; + const DEFAULT_BACKEND = 'file'; const DEFAULT_LOG_LEVEL = 2; const DEFAULT_TIMEZONE = 'UTC'; @@ -54,7 +54,7 @@ class Manage extends Command { 'backend', null, InputOption::VALUE_REQUIRED, - 'set the logging backend [owncloud, syslog, errorlog]' + 'set the logging backend [file, syslog, errorlog]' ) ->addOption( 'level', |