summaryrefslogtreecommitdiffstats
path: root/lib/private/Log.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-10 12:58:23 +0100
committerJoas Schilling <coding@schilljs.com>2017-01-10 12:59:13 +0100
commit7fa063ceca5d78741c47f645c6dfdf65e4be7330 (patch)
tree6894dac927deab5158ca6bc31754ce57d53748d0 /lib/private/Log.php
parente7ff1ba548ad4f8661f8309157336d376d6fb937 (diff)
downloadnextcloud-server-7fa063ceca5d78741c47f645c6dfdf65e4be7330.tar.gz
nextcloud-server-7fa063ceca5d78741c47f645c6dfdf65e4be7330.zip
Better fallback for unknown log types
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Log.php')
-rw-r--r--lib/private/Log.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php
index 5ba19698612..fddd3593127 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -330,18 +330,19 @@ class Log implements ILogger {
* @internal
*/
public static function getLogClass($logType) {
- // TODO: Drop backwards compatibility for config in the future
switch (strtolower($logType)) {
+ case 'errorlog':
+ return \OC\Log\Errorlog::class;
+ case 'syslog':
+ return \OC\Log\Syslog::class;
+ case 'file':
+ return \OC\Log\File::class;
+
+ // Backwards compatibility for old and fallback for unknown log types
case 'owncloud':
case 'nextcloud':
- $logType = 'file';
+ default:
+ return \OC\Log\File::class;
}
- $logClass = 'OC\\Log\\' . ucfirst($logType);
-
- if (!class_exists($logClass)) {
- $logClass = \OC\Log\File::class;
- }
-
- return $logClass;
}
}