Comments (7)
This appears to be an issue with Laravel, having looked at.
https://github.com/laravel/framework/blob/5.2/src/Illuminate/Foundation/Exceptions/Handler.php
parent::report(Exception $e)
is calling this parent method.
public function report(Exception $e)
{
if ($this->shouldReport($e)) {
$this->log->error($e);
}
}
$this->log
should be an implementation of LoggerInterface
and the signature should be error(Exception $e, array $context = [])
There's no way to pass contact through Laravel's implementation. I'll post up an issue later today. For the moment, it might be best to check whether Rollbar is enabled in your current environment and then decide whether to call \Log::error($e)
or parent::report($e)
from laravel-rollbar.
@gregrobson It looks like Laravel does not see this an error from their side. How did you resolve this? Is it safe to drop \Log::error($e);
? I'm seeing 95% of exceptions as duplicates, but sometimes they still come as one... Which seems odd to me...
from laravel-rollbar.
@sweet-greg the exceptions that only report once in rollbar are probably in your $dontReport
array in app/Hander.php
. The exceptions that report twice are not in your $dontReport
array, so they are being reported by the parent::report()
as well as your \Log::error($e)
call. That's my assumption anyway.
If that's the case, I think it would be much more intuitive to just let parent::report()
do it's thing, and not have laravel-rollbar users add the extra \Log::error($e)
. If I don't want to report a specific kind of exception, like a form ValidationException, then I likely don't want to see that exception in Rollbar. At my place of work, we just dropped the \Log::error($e)
from our app, and we see everything we need to see in Rollbar. If there's an exception we don't want to see, it goes in $dontReport
array 👍
TL;DR... I don't think there's any "fix" to be made here. Just stop suggesting \Log::error($e)
in the package README :) Thoughts?
from laravel-rollbar.
@jesseleite Thanks for getting back at me, if you check out parent::report()
the same check is done (although in reverse). So that should not be the reason for sometimes having no duplicates.
// Illuminate\Foundation\Exceptions\Handler@report
if ($this->shouldntReport($e)) {
return;
}
from laravel-rollbar.
That's exactly what I was getting at, but in much less words 😃 parent::report()
respects your $dontReport
array, and I think Rollbar should follow suit and respect your $dontReport
array. The extra \Log::error($e)
is confusing things for users of this package, and causing the duplicates.
@jenssegers thoughts?
from laravel-rollbar.
@gregrobson I agree with the issue you submitted to Laravel repo. It seems like @GrahamCampbell may have misunderstood what you were requesting. We want to pass the error context to parent::report($e)
and then we can remove \Log::error($e, $context)
entirely.
from laravel-rollbar.
This is old, but I've found a solution if you're using the Rollbar Service Provider. In report(Exception $e)
, you can add:
if ($user = Auth::user()) {
app('Rollbar\RollbarLogger')->configure([
'person' => [
'id' => $user->id,
'username' => $user->first_name . ' ' . $user->last_name,
'email' => $user->email,
],
]);
}
from laravel-rollbar.
Related Issues (20)
- Software license? HOT 1
- Laravel 5.4 Support HOT 4
- New version tag for Laravel 5.4 support HOT 1
- Rollbar access token required
- Have do you set the environment? HOT 1
- PHP 5.6 and Above Fails to Build HOT 1
- Only in production environment HOT 2
- Access token... which one? HOT 1
- JSON Body not sent to rollbar HOT 6
- Map PSR-3 levels to the ones available in Rollbar
- Updating Rollbar Dependency HOT 6
- Capacity to override default person without resorting to context in every log statement HOT 1
- Update 1.0.1 HOT 1
- composer update HOT 1
- issues with jobs
- rollbar/rollbar version 1.x support
- Update rollbar-php HOT 5
- Exception stack trace gone in Laravel 5.5 HOT 8
- Conditional registration of provider HOT 1
- Scrubber Issues 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 laravel-rollbar.