I have created different files for different level of logging e.g Log::info, Log::error etc. Now I also want to send a message to slack only if an error comes. I have done this too by writing following code in app/bootstrap.php
$app->configureMonologUsing( function($monolog) {
$slackHandler = new Monolog\Handler\SlackHandler(env('SLACK_TOKEN'), env('SLACK_CHANNEL'), 'Monolog', true, null, Monolog\Logger::ERROR);
$monolog->pushHandler($slackHandler);
});
but it has overrided the default logger and now only slack logger is working and no logs are adding in storage/logs/ folder