Skip to content

Commit fbd6e77

Browse files
author
Kiril Grancharov
committed
Added support for different log levels.
1 parent 057d26a commit fbd6e77

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ protected function configureHandlers(Application $app, Writer $log)
6868
*/
6969
protected function configureSingleHandler(Application $app, Writer $log)
7070
{
71-
$log->useFiles($app->storagePath().'/logs/laravel.log');
71+
$log->useFiles(
72+
$app->storagePath().'/logs/laravel.log',
73+
$app->make('config')->get('app.log_level', 'debug')
74+
);
7275
}
7376

7477
/**
@@ -80,9 +83,11 @@ protected function configureSingleHandler(Application $app, Writer $log)
8083
*/
8184
protected function configureDailyHandler(Application $app, Writer $log)
8285
{
86+
$config = $app->make('config');
8387
$log->useDailyFiles(
8488
$app->storagePath().'/logs/laravel.log',
85-
$app->make('config')->get('app.log_max_files', 5)
89+
$config->get('app.log_max_files', 5),
90+
$config->get('app.log_level', 'debug')
8691
);
8792
}
8893

@@ -95,7 +100,10 @@ protected function configureDailyHandler(Application $app, Writer $log)
95100
*/
96101
protected function configureSyslogHandler(Application $app, Writer $log)
97102
{
98-
$log->useSyslog('laravel');
103+
$log->useSyslog(
104+
'laravel',
105+
$app->make('config')->get('app.log_level', 'debug')
106+
);
99107
}
100108

101109
/**
@@ -107,6 +115,6 @@ protected function configureSyslogHandler(Application $app, Writer $log)
107115
*/
108116
protected function configureErrorlogHandler(Application $app, Writer $log)
109117
{
110-
$log->useErrorLog();
118+
$log->useErrorLog($app->make('config')->get('app.log_level', 'debug'));
111119
}
112120
}

0 commit comments

Comments
 (0)