Centralized logging is off by default. When enabled, the package registers a ranetrace Monolog driver you can wire into config/logging.php.
RANETRACE_LOGGING_ENABLED=true
In config/logging.php:
'channels' => [
'ranetrace' => [
'driver' => 'ranetrace',
'level' => env('LOG_LEVEL', 'notice'),
],
// …
],
The driver is registered as ranetrace via Log::extend('ranetrace', …) in the service provider. The level key is a standard Monolog level — only records at or above that level are forwarded.
To send logs to Ranetrace alongside your existing channels, add ranetrace to a stack:
'channels' => [
'production' => [
'driver' => 'stack',
'channels' => ['daily', 'ranetrace'],
'ignore_exceptions' => false,
],
'ranetrace' => [
'driver' => 'ranetrace',
'level' => env('LOG_LEVEL', 'notice'),
],
],
Then point the application at the stack:
LOG_CHANNEL=production
You can also log to Ranetrace directly:
use Illuminate\Support\Facades\Log;
Log::channel('ranetrace')->error('Webhook payload missing signature', [
'provider' => 'stripe',
]);
The handler skips records whose Monolog channel name appears in ranetrace.logging.excluded_channels. The list is empty by default:
// config/ranetrace.php
'logging' => [
'excluded_channels' => [
// Channel names that should never be sent to Ranetrace
],
],
From RanetraceLogHandler:
... (truncated) suffix.{"_truncated":"Context exceeded 50KB limit and was removed"}.These keep individual log records well under the API's 5 MB request limit.
php artisan ranetrace:test-logging
The command checks that the feature is enabled, the channel is defined, sends test entries at multiple levels, and prints what's missing if anything.
RANETRACE_LOGGING_ENABLED=false
Records will short-circuit at the handler.