Open
Description
Description
I would like to add Bugsnag to a reverse proxy project (.NET Core 3.1). Since this is not a classic MVC/WebAPI project, there are no controllers, and most of the code runs in a static context. The Bugsnag.AspNet.Core
package adds the Bugsnag client as scoped service, which makes it difficult to use in static contexts (from singleton services for example).
Describe the solution you'd like
Be able to register Bugsnag client as singleton service and use IHttpContextAccessor
to access request information where needed.
Describe alternatives you've considered
- Manually setup Bugsnag without the
Bugsnag.AspNet.Core
package - not great for me because I would like Bugsnag integration to be as easy as possible in all of our projects. - Create and publish my own package - this will probably be my temporary solution, eventually I would be happy to contribute my work back to this project.
Update - I created a package where the only change is adding Bugsnag.IClient
as a singleton instead of a scoped service, and looks like everything just works.