I am able to send the errors to bugsnag by creating my own LogServiceprovider and add this :
public function boot() { Log::listen(function(MessageLogged $message){ Bugsnag::notifyError($message->level, $message->message); }); }
But since nothing like this is mentioned in the log I'm wondering if this is the right way to handle this.
Log error not sent to bugsnag
Hello,
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 doc provided by bugsnag (not able to add a link to it since t's my first post but it's the official documentation) by:
-
Adding
bugsnag/bugsnag-laravelmodule -
Adding the service provider in my
app.php -
Adding the
BUGSNAG_API_KEYin my.envfile -
Adding 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.
Please or to participate in this conversation.