Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging with nested array as $context argument throws error #170

Closed
screambeard opened this issue Mar 19, 2025 · 1 comment · Fixed by #173
Closed

Logging with nested array as $context argument throws error #170

screambeard opened this issue Mar 19, 2025 · 1 comment · Fixed by #173
Assignees
Milestone

Comments

@screambeard
Copy link

I'm using the newest release of the Laravel PHP package (8.1.1) which uses the 4.1.0 version of rollbar-php-sdk. This version can result in the following error:

Named parameter $message overwrites previous argument {"exception":"[object] (Error(code: 0): Named parameter $message overwrites previous argument at vendor/rollbar/rollbar/src/Payload/TelemetryEvent.php:50)

This error is thrown if the body argument of the TelemetryEvent __construct function is a nested array. For example when using this package:

Log::info('This throws an error', [["data" => "some data]]);

The error is caused by the top-level nested array. This worked before, so this is regression of functionality.

Not sure what the best fix is, but the following line is the place within this package causing the eventual error in the rollbar-php package:

Rollbar::captureTelemetryEvent(
which triggers this issue.

Copy link

linear bot commented Mar 19, 2025

@danielmorell danielmorell self-assigned this Mar 21, 2025
@danielmorell danielmorell added this to the v8.1.2 milestone Mar 21, 2025
danielmorell added a commit that referenced this issue Mar 21, 2025
Fixed #170 by updating PHP-SDK from v4.1.0 to v4.1.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants