Skip to content

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

@screambeard

Description

@screambeard

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions