From acabdff2e3cde6bc98cc2d951a8fcadf22eb71f0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 4 Jan 2018 15:28:26 -0600 Subject: [PATCH] update log configuration file --- .env.example | 3 ++- config/app.php | 17 -------------- config/logging.php | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 config/logging.php diff --git a/.env.example b/.env.example index cd06cc8d..2dcaf819 100644 --- a/.env.example +++ b/.env.example @@ -2,9 +2,10 @@ APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true -APP_LOG_LEVEL=debug APP_URL=http://localhost +LOG_CHANNEL=single + DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 diff --git a/config/app.php b/config/app.php index 0e4ebed1..b16e7f77 100644 --- a/config/app.php +++ b/config/app.php @@ -108,23 +108,6 @@ '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'), - - 'log_level' => env('APP_LOG_LEVEL', 'debug'), - /* |-------------------------------------------------------------------------- | Autoloaded Service Providers diff --git a/config/logging.php b/config/logging.php new file mode 100644 index 00000000..0dd05d93 --- /dev/null +++ b/config/logging.php @@ -0,0 +1,57 @@ + env('LOG_CHANNEL', 'single'), + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels 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 Drivers: "single", "daily", "syslog", + | "errorlog", "custom" + | + */ + + 'channels' => [ + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 7, + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => 'debug', + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => 'debug', + ], + ], + +];