How to integrate Bugsnag?

Any idea how I can tackle this? Would like to integrate our error reporting web service.

They have integrations with plain PHP and Symfony. I’m thinking the pure PHP is best as assume Grav is not a Symphony app although it does use several components.

Any advice would be very welcome, thanks.

Grav uses Monolog, so it’s easy to add new error logging capabilities.

I found this handler for Monolog and Bugsnag

(there are others too).

You should make a small plugin that includes that library using Composer, and adds that to the Grav logger handlers:

$bugsnagClient = new Bugsnag\Client('YOUR-BUGSNAG-API-KEY-HERE');
$bugsnagHandler = new \MeadSteve\MonoSnag\BugsnagHandler($bugsnagClient);

(sample code, I didn’t try it, but refer to that lib README as well).

Any error should then be sent to Bugsnag as well.

Thanks. I’d got a plugin to send the errors to Bugsnag but the addition of a Monolog handler stopped it from hijacking the existing error handling which was happening in my first attempt.