1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 06:00:24 +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 7cec4d1f42
commit 687e1e2789

View File

@@ -174,7 +174,8 @@ class InstalledSite implements SiteInterface
protected function registerLogger(Container $container)
{
$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));
$container->instance('log', new Logger('flarum', [$handler]));