Closed agasigp closed 4 years ago
Hey @agasigp, it looks like all that's missing is a "default" log channel in your config/logging.php
file
In our Lumen 6 example, there is a specified default channel which is used by the LogManager when it logs an error. The error message you're getting — "Log [] is not defined" — implies that there is no default, as the name of the channel should be in the square brackets
So adding a default channel to config/logging.php
should fix your issue:
return [
'default' => env('LOG_CHANNEL', 'stack'),
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'bugsnag'],
],
...
'bugsnag' => [
'driver' => 'bugsnag',
],
],
];
I'd also generally recommend using stack
as the log channel, rather than bugsnag
. The bugsnag
channel will only send reports to Bugsnag, whereas using stack
will log errors to a file as well. Usually it's useful to have both, unless there's a specific reason why you only want errors reported to Bugsnag 🙂
Thanks for the explanation. Issue solved.
Expected behavior
Exceptions are sent to Bugsnag.
Observed behavior
Lumen cannot find the Bugsnag driver. This message is thrown in the log:
Steps to reproduce
I just make method in controller like this so it will throw FatalThrowableError syntax error :
Version
Additional information