Bridging the Monolog Ecosystem
Laravel 13 continues PHP's modern evolution with PHP 8.2+ type safety and lightning-fast route dispatch. However, logging in distributed microservices where PHP backends communicate with Node.js APIs often leads to fragmented log silos.
TracerNest provides native Laravel integration bridge files that route Laravel application telemetry into the same encrypted SQLite or MySQL storage vault as your Node.js services without opening extra ports.
Step-by-Step Installation & Setup
Step 1: Install Package & Copy Bridge Files
# Install TracerNest in your project
npm install tracernest-logger
# Copy integration bridge files to your Laravel application (or run: npx tracernest-install-laravel)
mkdir -p app/Http/Middleware app/Http/Controllers app/Logging config routes
cp node_modules/tracernest-logger/integrations/laravel/TracerNestMiddleware.php app/Http/Middleware/
cp node_modules/tracernest-logger/integrations/laravel/TracerNestController.php app/Http/Controllers/
cp node_modules/tracernest-logger/integrations/laravel/dashboard.html app/Http/Controllers/
cp node_modules/tracernest-logger/integrations/laravel/TracerNestMonologHandler.php app/Logging/
cp node_modules/tracernest-logger/integrations/laravel/tracernest.php config/
cp node_modules/tracernest-logger/integrations/laravel/routes.php routes/tracernest.php
Step 2: Add Monolog Channel in config/logging.php
Register the custom TracerNest Monolog handler to pipe all application logs (info, warning, error) into your telemetry vault:
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'tracernest'],
'ignore_exceptions' => false,
],
'tracernest' => [
'driver' => 'custom',
'via' => \App\Logging\TracerNestMonologHandler::class,
'level' => env('LOG_LEVEL', 'debug'),
],
],
Step 3: Register Routes in routes/web.php
// Load TracerNest dashboard and telemetry endpoint routes
if (file_exists(base_path('routes/tracernest.php'))) {
require base_path('routes/tracernest.php');
} else {
require base_path('node_modules/tracernest-logger/integrations/laravel/routes.php');
}
Step 4: Register Middleware in bootstrap/app.php (Laravel 13)
->withMiddleware(function (Middleware $middleware) {
$middleware->append(\App\Http\Middleware\TracerNestMiddleware::class);
})
Request Telemetry & Correlation IDs
When an HTTP request executes in Laravel, the TracerNest middleware automatically captures:
- Request correlation ID (intercepted from incoming
x-request-idheader) - Controller execution duration and HTTP status codes
- Peak memory consumption for the PHP process
- Uncaught exceptions and stack traces
All records are stored encrypted at rest without requiring background Redis or RabbitMQ queue daemons. Full automated W3C traceparent context propagation across distributed microservice hops is officially scheduled for the v2.0.0 architecture roadmap.