From aa7091d9624b8c2557e702bde0b738cfb75856c7 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 17 Oct 2017 20:04:07 -0700 Subject: [PATCH] Fixes #4226 - adds log_max_files to app config and sample env --- .env.example | 3 ++- app/Providers/AppServiceProvider.php | 4 +-- config/app.php | 37 ++++++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 2a34e9ae2c..51f9e3e5b2 100644 --- a/.env.example +++ b/.env.example @@ -97,7 +97,8 @@ LOGIN_LOCKOUT_DURATION=60 # -------------------------------------------- # OPTIONAL: MISC # -------------------------------------------- -APP_LOG=single +APP_LOG=daily +APP_LOG_MAX_FILES=10 APP_LOCKED=false FILESYSTEM_DISK=local APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1 diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 0e885f1045..9aea69bec7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -98,8 +98,8 @@ class AppServiceProvider extends ServiceProvider if (config('app.debug')) { $log_level = 'debug'; } else { - if (config('log-level')) { - $log_level = config('log-level'); + if (config('app.log_level')) { + $log_level = config('app.log_level'); } else { $log_level = 'error'; } diff --git a/config/app.php b/config/app.php index 6c9c471a5a..08befc2366 100755 --- a/config/app.php +++ b/config/app.php @@ -121,8 +121,41 @@ return [ | */ - 'log' => env('APP_LOG', 'single'), - 'log-level' => env('APP_LOG_LEVEL', 'error'), + 'log' => env('APP_LOG', 'daily'), + + /* + |-------------------------------------------------------------------------- + | Logging Max Files + |-------------------------------------------------------------------------- + | + | When using the daily log mode, Laravel will only retain 5 + | days of log files by default. + | + | To change this, set the APP_LOG_MAX_FILES option in your .env. + | + */ + + 'log_max_files' => env('APP_LOG_MAX_FILES', 5), + + /* + |-------------------------------------------------------------------------- + | Logging Detail + |-------------------------------------------------------------------------- + | + | By default, Laravel writes all log levels to storage. However, in your + | production environment, you may wish to configure the minimum severity that + | should be logged by editing your APP_LOG_LEVEL env config. + | + | Laravel will log all levels greater than or equal to the specified severity. + | For example, a default log_level of error will log error, critical, alert, + | and emergency messages. + | + | APP_LOG_LEVEL options are: + | "debug", "info", "notice", "warning", "error", "critical", "alert", "emergency" + | + */ + + 'log_level' => env('APP_LOG_LEVEL', 'error'), /*