apextoolbox / laravel-logger
Apex Toolbox Laravel Logger
1.0.0
2026-03-22 06:38 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.0
- illuminate/http: ^10 || ^11 || ^12
- illuminate/log: ^10 || ^11 || ^12
- illuminate/support: ^10 || ^11 || ^12
Requires (Dev)
- mockery/mockery: ^1.6.12@stable
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^10.0
README
Automatic error tracking, logging, and performance monitoring for Laravel applications. Part of ApexToolbox.
Installation
composer require apextoolbox/laravel-logger
Add to .env:
APEXTOOLBOX_ENABLED=true APEXTOOLBOX_TOKEN=your_token_here
Add the log channel to config/logging.php:
'channels' => [ // ... other channels 'apextoolbox' => [ 'driver' => 'monolog', 'handler' => \ApexToolbox\Logger\Handlers\ApexToolboxLogHandler::class, 'level' => 'debug', ], ],
Update .env to include the channel in your log stack:
LOG_STACK=daily,apextoolbox
Add the middleware for HTTP request tracking (optional):
// bootstrap/app.php (Laravel 11+) ->withMiddleware(function (Middleware $middleware) { $middleware->append(\ApexToolbox\Logger\Middleware\LoggerMiddleware::class); }) // Or app/Http/Kernel.php (Laravel 10) protected $middleware = [ \ApexToolbox\Logger\Middleware\LoggerMiddleware::class, ];
Done! The SDK automatically captures exceptions, logs, and database queries.
Configuration
Publish the config file for customization:
php artisan vendor:publish --tag=logger-config
This will create config/apextoolbox.php with the full configuration (all filtering options show their default values — you only need to override the sections you want to customize):
return [ 'enabled' => env('APEXTOOLBOX_ENABLED', true), 'token' => env('APEXTOOLBOX_TOKEN', ''), // Paths to include/exclude from logging (supports wildcards) 'path_filters' => [ 'include' => ['*'], 'exclude' => ['_debugbar/*', 'telescope/*', 'horizon/*', 'api/health', 'api/ping'], ], // Headers filtering // 'exclude' removes headers entirely, 'mask' replaces values with '*******' 'headers' => [ 'exclude' => [ 'authorization', 'x-api-key', 'cookie', 'x-auth-token', 'x-access-token', 'x-refresh-token', 'bearer', 'x-secret', 'x-private-key', 'authentication', ], 'mask' => [ 'ssn', 'social_security', 'phone', 'email', 'address', 'postal_code', 'zip_code', ], ], // Request body filtering // 'exclude' removes fields entirely, 'mask' replaces values with '*******' 'body' => [ 'exclude' => [ 'password', 'password_confirmation', 'token', 'access_token', 'refresh_token', 'api_key', 'secret', 'private_key', 'auth', 'authorization', 'social_security', 'credit_card', 'card_number', 'cvv', 'pin', 'otp', ], 'mask' => [ 'ssn', 'social_security', 'phone', 'email', 'address', 'postal_code', 'zip_code', ], ], // Response body filtering // 'exclude' removes fields entirely, 'mask' replaces values with '*******' 'response' => [ 'exclude' => [ 'password', 'password_confirmation', 'token', 'access_token', 'refresh_token', 'api_key', 'secret', 'private_key', 'auth', 'authorization', 'social_security', 'credit_card', 'card_number', 'cvv', 'pin', 'otp', ], 'mask' => [ 'ssn', 'social_security', 'phone', 'email', 'address', 'postal_code', 'zip_code', ], ], ];
Environment Variables
| Variable | Description | Default |
|---|---|---|
APEXTOOLBOX_TOKEN |
Your project token | Required |
APEXTOOLBOX_ENABLED |
Enable/disable tracking | true |
Requirements
- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
License
MIT