Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
rullzer authored and Backportbot committed Jan 7, 2019
commit 7416ce20a01def290f456bd19ce248db9f4e30fa
5 changes: 3 additions & 2 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,16 @@ public function __construct($webRoot, \OC\Config $config) {

$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);
$registry = $c->query(\OCP\Support\CrashReport\IRegistry::class);

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());
Expand Down
5 changes: 2 additions & 3 deletions settings/Controller/LogSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
use OC\Log;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\StreamResponse;
use OCP\ILogger;
use OCP\IRequest;

/**
Expand All @@ -39,10 +38,10 @@
*/
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;
}
Expand Down