1
0
mirror of https://github.com/flarum/core.git synced 2025-08-02 22:47:33 +02:00

Use proper log level depending on debug mode

This commit is contained in:
Alexander Skvortsov
2022-01-05 21:45:27 -05:00
parent 27294e8e0e
commit 52896144e1

View File

@@ -174,7 +174,8 @@ class InstalledSite implements SiteInterface
protected function registerLogger(Container $container) protected function registerLogger(Container $container)
{ {
$logPath = $this->paths->storage.'/logs/flarum.log'; $logPath = $this->paths->storage.'/logs/flarum.log';
$handler = new RotatingFileHandler($logPath, 0, Logger::INFO); $logLevel = $this->config->inDebugMode() ? Logger::DEBUG : Logger::INFO;
$handler = new RotatingFileHandler($logPath, 0, $logLevel);
$handler->setFormatter(new LineFormatter(null, null, true, true)); $handler->setFormatter(new LineFormatter(null, null, true, true));
$container->instance('log', new Logger('flarum', [$handler])); $container->instance('log', new Logger('flarum', [$handler]));