I have a Lumen 8 app where I want to use bugsnag to be notified when my app is logging some error.
I have followed the docs by:
Adding
bugsnag/bugsnag-laravelmoduleAdding the service provider in my
app.phpAdding the
BUGSNAG_API_KEYin my.envfileAdding the bugsnag channel in my
config/services.phpfile'channels' => [ 'stack' => [ 'driver' => 'stack', 'channels' => ['single', 'bugsnag'], ], 'bugsnag' => [ 'driver' => 'bugsnag', ], ],Adding this in the
Exceptions/Handler.phpfileif (app()->bound('bugsnag') && $this->shouldReport($exception)) { Bugsnag::notifyException($exception); }
If I have an exception that is triggered by my app, it is reported correctly to my bugsnag dashboard (and I am notified by email), but if I have a log like Log::critical("something crashed"); the log is correctly written in my log file but nothing is sent to bugsnag.
Any idea what I am missing here?
Thank you for your help.
I am able to send the errors to Bugsnag by creating my own
LogServiceproviderand add this:But since nothing like this is mentioned in the documentation I'm wondering if this is the right way to handle this.