Skip to content

Commit

Permalink
Added support for different log levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiril Grancharov committed May 11, 2016
1 parent 057d26a commit fbd6e77
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ protected function configureHandlers(Application $app, Writer $log)
*/
protected function configureSingleHandler(Application $app, Writer $log)
{
$log->useFiles($app->storagePath().'/logs/laravel.log');
$log->useFiles(
$app->storagePath().'/logs/laravel.log',
$app->make('config')->get('app.log_level', 'debug')
);
}

/**
Expand All @@ -80,9 +83,11 @@ protected function configureSingleHandler(Application $app, Writer $log)
*/
protected function configureDailyHandler(Application $app, Writer $log)
{
$config = $app->make('config');
$log->useDailyFiles(
$app->storagePath().'/logs/laravel.log',
$app->make('config')->get('app.log_max_files', 5)
$config->get('app.log_max_files', 5),
$config->get('app.log_level', 'debug')
);
}

Expand All @@ -95,7 +100,10 @@ protected function configureDailyHandler(Application $app, Writer $log)
*/
protected function configureSyslogHandler(Application $app, Writer $log)
{
$log->useSyslog('laravel');
$log->useSyslog(
'laravel',
$app->make('config')->get('app.log_level', 'debug')
);
}

/**
Expand All @@ -107,6 +115,6 @@ protected function configureSyslogHandler(Application $app, Writer $log)
*/
protected function configureErrorlogHandler(Application $app, Writer $log)
{
$log->useErrorLog();
$log->useErrorLog($app->make('config')->get('app.log_level', 'debug'));
}
}

0 comments on commit fbd6e77

Please sign in to comment.