From 3dde57f9da0b978af38e6d70e01efed901aa01d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Tue, 9 Oct 2018 19:54:52 +0200 Subject: [PATCH] adds log rotation, reducing file size per log file and easier to delete --- framework/core/src/Foundation/InstalledSite.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Foundation/InstalledSite.php b/framework/core/src/Foundation/InstalledSite.php index 679b65e05..f3ace86b7 100644 --- a/framework/core/src/Foundation/InstalledSite.php +++ b/framework/core/src/Foundation/InstalledSite.php @@ -43,7 +43,7 @@ use Illuminate\Mail\MailServiceProvider; use Illuminate\Validation\ValidationServiceProvider; use Illuminate\View\ViewServiceProvider; use Monolog\Formatter\LineFormatter; -use Monolog\Handler\StreamHandler; +use Monolog\Handler\RotatingFileHandler; use Monolog\Logger; use Psr\Log\LoggerInterface; @@ -219,7 +219,7 @@ class InstalledSite implements SiteInterface private function registerLogger(Application $app) { $logPath = $app->storagePath().'/logs/flarum.log'; - $handler = new StreamHandler($logPath, Logger::INFO); + $handler = new RotatingFileHandler($logPath, Logger::INFO); $handler->setFormatter(new LineFormatter(null, null, true, true)); $app->instance('log', new Logger($app->environment(), [$handler]));