apextoolbox/laravel-logger

Apex Toolbox Laravel Logger

Maintainers

Package info

github.com/apextoolbox/laravel-logger

pkg:composer/apextoolbox/laravel-logger

Statistics

Installs: 884

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

1.0.0 2026-03-22 06:38 UTC

This package is auto-updated.

Last update: 2026-03-22 06:40:30 UTC


README

PHP Version Laravel

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