Skip to content

Instantly share code, notes, and snippets.

@jamesfairhurst
Last active January 19, 2017 21:44
Show Gist options
  • Save jamesfairhurst/fb2894acc05aa77ed964c58a278d3287 to your computer and use it in GitHub Desktop.
Save jamesfairhurst/fb2894acc05aa77ed964c58a278d3287 to your computer and use it in GitHub Desktop.
Configuring Multiple Laravel Log Files
$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;
});
Log::debug('debug');
Log::info('info');
Log::notice('notice');
Log::warning('warning');
Log::error('error');
Log::critical('critical');
Log::alert('alert');
Log::emergency('emergency');
@jamesfairhurst
Copy link
Author

jamesfairhurst commented Jan 19, 2017

Medium writeup & explanation for the above code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment