Rollbar Logs Errors Despite Being Disabled in Laravel 12
Description:
I’ve been trying to report this issue for a while but struggled to identify a consistent reproduction case until now. I’m using Laravel 12 with the latest versions of rollbar/rollbar-php and rollbar/rollbar-laravel. I believe the issue originates in the base rollbar-php package rather than the rollbar-laravel wrapper, as errors are logged to Rollbar despite it being disabled. Below are my config/logging.php and .env configurations for my local environment:
return [
'default' => env('LOG_CHANNEL', 'single'),
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => env('LOG_STACK', 'single'),
'ignore_exceptions' => false,
],
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=single
The above configuration does not reference Rollbar, yet errors are intermittently logged to my Rollbar account. I’ve discovered that I can consistently reproduce this issue by calling dump() within a synchronous job, triggering an error every time.
<?php
namespace App\Jobs;
use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class DevJob_ implements ShouldQueue
{
use Dispatchable;
public function handle(): void
{
dump(['foo' => 'bar']);
}
}
Then in web.php
Route::get('/dev-job', fn () => \App\Jobs\DevJob_::dispatchSync());
Please let me know if you need any additional information to investigate this issue. Thank you!
Hey @azgooon, Sorry for the late response. Is this still an issue?
The only thing I can think of is that there might be something else initializing Rollbar.
yes, @danielmorell the issue persists even in the version 4.1.4
Is the Rollbar service provider still initialized in your bootstrap/providers.php file?
Disconnecting the Rollbar service provider from the Laravel logging system only removes one of the methods you can send data to the Rollbar package. If the service provider is still initialized it will still register shutdown functions and try to capture errors, and exceptions.
@azgooon were you able to test my last suggestion?