Comments (4)
@stayallive thanks. Stayalive 👍
from sentry-laravel.
Hey @adnanmayo,
Please read the readme, it is explained there how to do that: https://github.com/getsentry/sentry-laravel#adding-context
If you have trouble figuring out what to make of $sentry->user_context([...]);
, here is a example:
$user = auth()->user();
$sentry->user_context([
'id' => $user->id,
'email' => $user->email,
]);
from sentry-laravel.
@stayallive thanks for your response.
public function report(Exception $e) { if ($this->shouldReport($e)) { if (app()->bound('sentry')) { $sentry = app('sentry'); if (auth()->check()) { $sentry->user_context([ "user_id" => \Auth::id(), "email" => \Auth::user()->email ]); } else { $sentry->user_context(['id' => null]); } $sentry->tags_context([]); } app('sentry')->captureException($e); } parent::report($e); }
i am trying i this way, if i am wrong can you please guide me how i can achieve this. Can you please also tell what is $sentry->tags_context([...]);
from sentry-laravel.
@adnanmayo That should also work.
Tags context sets the value of tags, you can for example add the php version as a tag or the route action and so forth. You can read more about the configuration options in the sentry-php
docs: https://docs.sentry.io/hosted/clients/php/config/#available-settings
from sentry-laravel.
Related Issues (20)
- Idle timeout reached HOT 4
- Scheduled task tracing
- Disabling SSL Verify Peer HOT 2
- Add support for Laravel 11.0's Context
- Link to Laravel v10 docs broken HOT 2
- Dependency nyholm/psr7 can be defined like require-dev HOT 1
- Does captureUnhandleException still work for Laravel 11 HOT 1
- SQLSTATE[HY000]: General error: 2006 MySQL server has gone away HOT 6
- Metrics Rate Limits HOT 1
- Wrong stack trace when using in-app middleware HOT 6
- FilesystemAdapterDecorator incompatibility in tests. HOT 2
- Performance monitoring doesn't work in artisan commands
- LighthouseIntegration does not report all the traces to Sentry HOT 4
- Call to undefined function Sentry\metrics() HOT 8
- Setting http_proxy in config/sentry.php on L10 seems to not work HOT 2
- before_send_check_in breaks serialization when using php artisan optimize HOT 4
- Possible bug if transaction is not sampled? HOT 4
- Sentry delays execution of scheduled commands when offline HOT 4
- Inform via Log in case Sentry Requests Timeout or Fail HOT 1
- Ingestion Requests affect API Response Times for Users HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-laravel.