Error tracking is on by default (errors.enabled = true), but it captures nothing until you wire Ranetrace into Laravel's exception handler. That one line is required.
In bootstrap/app.php, call Ranetrace::handles() inside ->withExceptions():
use Illuminate\Foundation\Configuration\Exceptions;
use Ranetrace\Laravel\Facades\Ranetrace;
->withExceptions(function (Exceptions $exceptions) {
Ranetrace::handles($exceptions);
})
Without this wiring, unhandled exceptions are not captured (though Ranetrace::report($exception) still works for in-flow calls). handles() preserves Laravel's own default logging. Once it is in place, anything that flows through Laravel's report(), including unhandled exceptions Laravel catches, reaches Ranetrace::report($exception) and is sent to Ranetrace after the worker runs.
From Ranetrace\Laravel\Ranetrace::report():
cookie, authorization, x-csrf-token, x-xsrf-token.argv.use Ranetrace\Laravel\Facades\Ranetrace;
Ranetrace::report($exception);
report() takes a single Throwable argument — there is no second context parameter.
You can also call Laravel's built-in report() helper; it routes through the same handler:
try {
$this->thirdPartyApi->sync();
} catch (Throwable $exception) {
report($exception);
}
php artisan ranetrace:test-errors
From config/ranetrace.php:
'errors' => [
'enabled' => env('RANETRACE_ERRORS_ENABLED', true),
'queue' => env('RANETRACE_ERRORS_QUEUE', true),
'queue_name' => env('RANETRACE_ERRORS_QUEUE_NAME', 'default'),
'timeout' => env('RANETRACE_ERRORS_TIMEOUT', 10),
],
To disable without uninstalling:
RANETRACE_ERRORS_ENABLED=false