Laravel 5.6 introduced a new Monolog-based logging system that replaces the Illuminate\\Contracts\\Logging\\Log class with Illuminate\\Log\\LogManager. To upgrade Bugsnag, you must remove the old manual aliases and instead add Bugsnag as a channel to your logging stack.
1. Remove old aliases
In app/Providers/AppServiceProvider.php, remove the following lines from the register method:
// Remove these if they exist:
$this->app->alias('bugsnag.logger', \Illuminate\\Contracts\\Logging\\Log::class);
$this->app->alias('bugsnag.logger', \Psr\\Log\\LoggerInterface::class);
// Or if using the multi-logger, remove these:
$this->app->alias('bugsnag.multi', \Illuminate\\Contracts\\Logging\\Log::class);
$this->app->alias('bugsnag.multi', \Psr\\Log\\LoggerInterface::class);
2. Configure the logging channel
Add the bugsnag driver to your config/logging.php file by creating a new channel and adding it to your stack channel.
// config/logging.php
'channels' => [
'stack' => [
'driver' => 'stack',
// Add bugsnag to the stack:
'channels' => ['single', 'bugsnag'],
],
// ...
// Create a bugsnag logging channel:
'bugsnag' => [
'driver' => 'bugsnag',
],
],