Skip to content

A free open source IT asset/license management system

Fixes #4226 - adds log_max_files to app config and sample env

snipeaa7091d9624b
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'),
/*