bugsnag / bugsnag-laravel

BugSnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
https://docs.bugsnag.com/platforms/php/laravel/
MIT License
876 stars 129 forks source link

Attach Laravel's Context to events as metadata #537

Closed imjoehaines closed 5 months ago

imjoehaines commented 5 months ago

Goal

Laravel 11 added a new Context feature that allows adding arbitrary metadata to its logging system

This PR adds support for reading from the Context and attaching it to events as metadata

There is a new configuration option, attach_hidden_context (or environment variable BUGSNAG_ATTACH_HIDDEN_CONTEXT), that controls whether "hidden context" is added as metadata as well. This is disabled by default to avoid accidentally leaking data

See also #536 & https://laravel.com/docs/11.x/context