From 7057cb010431b234860f3a3906b4d7b83ca014a0 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 25 Jul 2022 18:44:37 -0700 Subject: [PATCH 1/4] 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 227d80788..cf5e3cae7 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 d57e5a017..6b3f70d18 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 1aa06aa30..c18101d0a 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 211bbeda5b9e45bb3f179dcd2e3d4dd88543d366 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 25 Jul 2022 18:53:17 -0700 Subject: [PATCH 2/4] Added link to SEDC / perl-www-snipe Signed-off-by: snipe --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8fd4f4cb..b83894714 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,9 @@ Since the release of the JSON REST API, several third-party developers have been - [Snipe-IT Kubernetes Helm Chart](https://github.com/t3n/helm-charts/tree/master/snipeit) - For more information, [click here](https://hub.helm.sh/charts/t3n/snipeit). - [Snipe-IT Bulk Edit](https://github.com/bricelabelle/snipe-it-bulkedit) - Google Script files to use Google Sheets as a bulk checkout/checkin/edit tool for Snipe-it. - [MosyleSnipeSync](https://github.com/RodneyLeeBrands/MosyleSnipeSync) by [@RodneyLeeBrands](https://github.com/RodneyLeeBrands) - Python script to synchronize information between Mosyle and Snipe-IT +- [WWW::SnipeIT](https://github.com/SEDC/perl-www-snipeit) by [@SEDC](https://github.com/SEDC) - perl module for accessing the API -As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :) +As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :) ----- From 0c7d4a709aa458f1bbfdbaf62f9e46a2467532c2 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 25 Jul 2022 19:25:06 -0700 Subject: [PATCH 3/4] 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 6c64c8074..9a68c1b25 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 90c785e94..d7e022c79 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 6b3f70d18..c3627ddea 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 c18101d0a..2f884d3ac 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 4/4] 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 9a68c1b25..8c47c801e 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 abf54cf77..6f8c31de4 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 d7e022c79..2d56fc5bb 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 cf5e3cae7..eefb61c25 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 af698f840..7b91a44b5 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 c2cdd7b9e..c8ed42c3b 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" },