jenssegers / laravel-rollbar

Rollbar error monitoring integration for Laravel projects
329 stars 99 forks source link

JSON Body not sent to rollbar #79

Open tobz-nz opened 7 years ago

tobz-nz commented 7 years ago

Is it just me or is the json body of a request not sent along with the error? I get headers & GET/POST data, but no JSON body content

mrtimp commented 7 years ago

@tobz-nz are you getting an error like "API error: Invalid format. data.body must not be undefined. Instead, it should be an object with a 'message', 'trace', 'trace_chain', or 'crash_report' key."? If this is the case I found that laravel-rollbar is tied to 0.15 of rollbar/rollbar which has the following:

https://github.com/rollbar/rollbar-php/blob/v0.15.0/src/rollbar.php#L289

notice the UTF-8//IGNORE and it looks based on PHP comments:

http://php.net/manual/en/function.iconv.php#108643

That this is not supported in newer versions of PHP, in my case we are using PHP 7.1 and have hit this issue.

tobz-nz commented 7 years ago

My version constraint it "jenssegers/rollbar": "^1.5", (installed version is 1.5.1) I just have the default Laravel setup. I have an api, when a request comes in with a json body & an error occurs the request body is not sent through to Rollbar. I've not configured anything manually to do with sending the error. Do I need to do some extra setup?

mrtimp commented 7 years ago

I should have clarified that the error "API error: ..." was actually an exception that was displayed inside the Rollbar dashboard. So if you aren't seeing that then its likely not the same issue I've hit.

Are you sure you've followed all of the steps here:

https://github.com/jenssegers/laravel-rollbar#installation

You need to ensure that you've configured the service provider, configured it with your Rollbar token etc and attached it to your exception/error handler.

edbentinck commented 7 years ago

I had the same problem. Couldn't get it to work with this package, but the official package from Rollbar (forked from this one) worked out of the box for me.

mThallerWeb commented 7 years ago

Same issue here, but's not directly a bug in this, plain body data ist not recognized by the official rollbar package. Can you maybe update the official rollbar package in the dependencies?

jschlies commented 6 years ago

I'm having the same issue as @mThallerWeb.