Added log level configuration param

Change-Id: I19e7528460ea3600abdf7d54b2d91d1fa89f1e10
This commit is contained in:
Sebastian Marcet 2016-02-23 16:07:21 -03:00
parent 33526e903d
commit b72a7aa35f
3 changed files with 17 additions and 10 deletions

View File

@ -52,4 +52,5 @@ ACCESS_TOKEN_CACHE_LIFETIME=300
API_RESPONSE_CACHE_LIFETIME=600
LOG_EMAIL_TO=smarcet@gmail.com
LOG_EMAIL_FROM=smarcet@gmail.com
LOG_EMAIL_FROM=smarcet@gmail.com
LOG_LEVEL=info

View File

@ -18,6 +18,10 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
$monolog = Log::getMonolog();
foreach($monolog->getHandlers() as $handler) {
$handler->setLevel(Config::get('log.level', 'error'));
}
//set email log
$to = Config::get('log.to_email');

View File

@ -1,10 +1,12 @@
<?php
return array(
/**
* EMAIL ERROR LOG CONFIGURATION
*/
//The receiver of the mail
'to_email' => env('LOG_EMAIL_TO'),
//The sender of the mail
'from_email' => env('LOG_EMAIL_FROM'),
);
return array(
/**
* EMAIL ERROR LOG CONFIGURATION
*/
//The receiver of the mail
'to_email' => env('LOG_EMAIL_TO'),
//The sender of the mail
'from_email' => env('LOG_EMAIL_FROM'),
//Log Level (debug, info, notice, warning, error, critical, alert)
'level' => env('LOG_LEVEL', 'error'),
);