Use the real logger in the settings

Fixes #13285
The wrapper logger should not be used here. But we need the real logger.
Since this in internal we can just pass that on directly.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-01-07 12:32:07 +01:00
parent b820803cf1
commit 8e914c01c5
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 5 additions and 5 deletions

View File

@ -553,7 +553,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
$this->registerService(\OCP\ILogger::class, function (Server $c) {
$this->registerService(\OC\Log::class, function (Server $c) {
$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
$factory = new LogFactory($c, $this->getSystemConfig());
$logger = $factory->get($logType);
@ -561,7 +561,8 @@ class Server extends ServerContainer implements IServerContainer {
return new Log($logger, $this->getSystemConfig(), null, $registry);
});
$this->registerAlias('Logger', \OCP\ILogger::class);
$this->registerAlias(\OCP\ILogger::class, \OC\Log::class);
$this->registerAlias('Logger', \OC\Log::class);
$this->registerService(ILogFactory::class, function (Server $c) {
return new LogFactory($c, $this->getSystemConfig());

View File

@ -29,7 +29,6 @@ namespace OC\Settings\Controller;
use OC\Log;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\StreamResponse;
use OCP\ILogger;
use OCP\IRequest;
/**
@ -39,10 +38,10 @@ use OCP\IRequest;
*/
class LogSettingsController extends Controller {
/** @var ILogger */
/** @var Log */
private $log;
public function __construct(string $appName, IRequest $request, ILogger $logger) {
public function __construct(string $appName, IRequest $request, Log $logger) {
parent::__construct($appName, $request);
$this->log = $logger;
}