From 7057cb010431b234860f3a3906b4d7b83ca014a0 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 25 Jul 2022 18:44:37 -0700 Subject: [PATCH 1/3] Make all *_LOG_LEVEL vars consistent; set default to 'warning' --- .env.testing | 2 +- config/app.php | 20 -------------------- config/logging.php | 12 ++++++------ 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/.env.testing b/.env.testing index 227d80788f..cf5e3cae72 100644 --- a/.env.testing +++ b/.env.testing @@ -71,4 +71,4 @@ SECURE_COOKIES=false # OPTIONAL: APP LOG FORMAT # -------------------------------------------- APP_LOG=single -APP_LOG_LEVEL=debug +LOG_LEVEL=debug diff --git a/config/app.php b/config/app.php index d57e5a0177..6b3f70d184 100755 --- a/config/app.php +++ b/config/app.php @@ -158,26 +158,6 @@ return [ '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'), - /* |-------------------------------------------------------------------------- | Default Storage path for private uploads diff --git a/config/logging.php b/config/logging.php index 1aa06aa30f..c18101d0a9 100644 --- a/config/logging.php +++ b/config/logging.php @@ -44,13 +44,13 @@ return [ 'single' => [ 'driver' => 'single', 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), ], 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), 'days' => 14, ], @@ -64,7 +64,7 @@ return [ 'papertrail' => [ 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), 'handler' => SyslogUdpHandler::class, 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), @@ -74,7 +74,7 @@ return [ 'stderr' => [ 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ @@ -84,12 +84,12 @@ return [ 'syslog' => [ 'driver' => 'syslog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), ], 'null' => [ From 0c7d4a709aa458f1bbfdbaf62f9e46a2467532c2 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 25 Jul 2022 19:25:06 -0700 Subject: [PATCH 2/3] Cleaned up more logging options --- .env.docker | 2 +- .env.example | 2 +- config/app.php | 29 ----------------------------- config/logging.php | 2 +- 4 files changed, 3 insertions(+), 32 deletions(-) diff --git a/.env.docker b/.env.docker index 6c64c8074b..9a68c1b253 100644 --- a/.env.docker +++ b/.env.docker @@ -156,7 +156,7 @@ RESET_PASSWORD_LINK_EXPIRES=900 # OPTIONAL: MISC # -------------------------------------------- APP_LOG=stderr -APP_LOG_MAX_FILES=10 +LOG_MAX_DAYS=10 APP_LOCKED=false APP_CIPHER=AES-256-CBC GOOGLE_MAPS_API= diff --git a/.env.example b/.env.example index 90c785e94b..d7e022c79a 100644 --- a/.env.example +++ b/.env.example @@ -159,7 +159,7 @@ PASSWORD_RESET_MAX_ATTEMPTS_PER_MIN=50 # OPTIONAL: MISC # -------------------------------------------- APP_LOG=single -APP_LOG_MAX_FILES=10 +LOG_MAX_DAYS=10 APP_LOCKED=false APP_CIPHER=AES-256-CBC APP_FORCE_TLS=false diff --git a/config/app.php b/config/app.php index 6b3f70d184..c3627ddea6 100755 --- a/config/app.php +++ b/config/app.php @@ -129,35 +129,6 @@ return [ 'cipher' => env('APP_CIPHER', 'AES-256-CBC'), - /* - |-------------------------------------------------------------------------- - | Logging Configuration - |-------------------------------------------------------------------------- - | - | Here you may configure the log settings for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Settings: "single", "daily", "syslog", "errorlog" - | - */ - - 'log' => env('APP_LOG', 'single'), - - /* - |-------------------------------------------------------------------------- - | 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), - /* |-------------------------------------------------------------------------- | Default Storage path for private uploads diff --git a/config/logging.php b/config/logging.php index c18101d0a9..2f884d3acd 100644 --- a/config/logging.php +++ b/config/logging.php @@ -51,7 +51,7 @@ return [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'warning'), - 'days' => 14, + 'days' => env('LOG_MAX_DAYS', 14), ], 'slack' => [ From 1981b7955777cea59b4954b8edc791968c429244 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 25 Jul 2022 19:57:14 -0700 Subject: [PATCH 3/3] Good catch! APP_LOG -> LOG_CHANNEL --- .env.docker | 2 +- .env.dusk.local | 2 +- .env.example | 2 +- .env.testing | 2 +- .env.testing-ci | 2 +- app.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.docker b/.env.docker index 9a68c1b253..8c47c801e2 100644 --- a/.env.docker +++ b/.env.docker @@ -155,7 +155,7 @@ RESET_PASSWORD_LINK_EXPIRES=900 # -------------------------------------------- # OPTIONAL: MISC # -------------------------------------------- -APP_LOG=stderr +LOG_CHANNEL=stderr LOG_MAX_DAYS=10 APP_LOCKED=false APP_CIPHER=AES-256-CBC diff --git a/.env.dusk.local b/.env.dusk.local index abf54cf77e..6f8c31de49 100644 --- a/.env.dusk.local +++ b/.env.dusk.local @@ -93,7 +93,7 @@ DISABLE_NOSAML_LOCAL_LOGIN=true # -------------------------------------------- # OPTIONAL: MISC # -------------------------------------------- -APP_LOG=single +LOG_CHANNEL=single LOG_LEVEL=debug LOG_CHANNEL=stack LOG_SLACK_WEBHOOK_URL=null diff --git a/.env.example b/.env.example index d7e022c79a..2d56fc5bbf 100644 --- a/.env.example +++ b/.env.example @@ -158,7 +158,7 @@ PASSWORD_RESET_MAX_ATTEMPTS_PER_MIN=50 # -------------------------------------------- # OPTIONAL: MISC # -------------------------------------------- -APP_LOG=single +LOG_CHANNEL=single LOG_MAX_DAYS=10 APP_LOCKED=false APP_CIPHER=AES-256-CBC diff --git a/.env.testing b/.env.testing index cf5e3cae72..eefb61c257 100644 --- a/.env.testing +++ b/.env.testing @@ -70,5 +70,5 @@ SECURE_COOKIES=false # -------------------------------------------- # OPTIONAL: APP LOG FORMAT # -------------------------------------------- -APP_LOG=single +LOG_CHANNEL=single LOG_LEVEL=debug diff --git a/.env.testing-ci b/.env.testing-ci index af698f8400..7b91a44b59 100644 --- a/.env.testing-ci +++ b/.env.testing-ci @@ -34,4 +34,4 @@ IMAGE_LIB=gd # -------------------------------------------- # OPTIONAL: APP LOG FORMAT # -------------------------------------------- -APP_LOG=single \ No newline at end of file +LOG_CHANNEL=single \ No newline at end of file diff --git a/app.json b/app.json index c2cdd7b9e0..c8ed42c3bd 100644 --- a/app.json +++ b/app.json @@ -118,7 +118,7 @@ "description": "The duration (in seconds) that the user should be blocked from attempting to authenticate again.", "value": "60" }, - "APP_LOG": { + "LOG_CHANNEL": { "description": "Driver to send logs to. (errorlog for stderr)", "value": "errorlog" },