TheoKouzelis / laravel-airbrake

Laravel service provider for Airbrake https://github.com/airbrake/phpbrake
MIT License
25 stars 24 forks source link

Error Reporting only on Production? #21

Closed christoph-werker closed 2 years ago

christoph-werker commented 2 years ago

Hello Guys,

how can i report only online Errors in Production mode?

TheoKouzelis commented 2 years ago

It depends how you've implement the package into laravel. If you are using the log stacks, you can create different stack for each environment. Then set which stack you want to use by changing the value of LOG_CHANNEL in .env https://laravel.com/docs/9.x/logging#introduction

Otherwise if you're using the exception handler, you can check the environment before sending the error to airbrake https://laravel.com/docs/9.x/configuration#determining-the-current-environment

TheoKouzelis commented 2 years ago

Exception handler example is now in the docs https://github.com/TheoKouzelis/laravel-airbrake/commit/02bdf9e7ef35959f7ec7974c7e3cd14eb10ed5c4

christoph-werker commented 2 years ago

Thanks