Last active
January 19, 2017 21:44
-
-
Save jamesfairhurst/fb2894acc05aa77ed964c58a278d3287 to your computer and use it in GitHub Desktop.
Configuring Multiple Laravel Log Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app->configureMonologUsing(function ($monolog) use ($app) { | |
$monolog->pushHandler(new Monolog\Handler\StreamHandler($app->storagePath() . '/logs/info.log', Monolog\Logger::DEBUG, false)); | |
$monolog->pushHandler(new Monolog\Handler\StreamHandler($app->storagePath() . '/logs/laravel.log', Monolog\Logger::NOTICE, false)); | |
return $monolog; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Log::debug('debug'); | |
Log::info('info'); | |
Log::notice('notice'); | |
Log::warning('warning'); | |
Log::error('error'); | |
Log::critical('critical'); | |
Log::alert('alert'); | |
Log::emergency('emergency'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Medium writeup & explanation for the above code.