Skip to content

Commit

Permalink
refactor: use environment variable to define log level (#627)
Browse files Browse the repository at this point in the history
* docs: update proxy documentation

* refactor: use environment variable to define log level
  • Loading branch information
warlof authored Jul 19, 2020
1 parent 28c0d2a commit 2bb6a3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ APP_NAME=SeAT
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_LOG_LEVEL=error
APP_URL=http://localhost

LOG_CHANNEL=stack
Expand All @@ -20,7 +21,6 @@ QUEUE_CONNECTION=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120

QUEUE_BALANCING_MODE=auto
QUEUE_WORKERS=10

REDIS_HOST=127.0.0.1
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class TrustProxies extends Middleware
/**
* The trusted proxies for this application.
*
* @var array
* @var array|string|null
*/
protected $proxies = '*';

/**
* The current proxy header mappings.
*
* @var array
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}
10 changes: 5 additions & 5 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'level' => env('APP_LOG_LEVEL', 'error'),
],

'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'level' => env('APP_LOG_LEVEL', 'error'),
'days' => 14,
],

Expand All @@ -64,7 +64,7 @@

'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'level' => env('APP_LOG_LEVEL', 'error'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
Expand All @@ -83,12 +83,12 @@

'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
'level' => env('APP_LOG_LEVEL', 'error'),
],

'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
'level' => env('APP_LOG_LEVEL', 'error'),
],

'null' => [
Expand Down

0 comments on commit 2bb6a3a

Please sign in to comment.