Skip to content

eur-rsm/laravel-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Enrich Laravel Logging

Enrich monolog logs with laravel context

Installation

Add the Logger as 'tap' override in config/logging.php.

return [
    // ...
    'single' => [
        'driver' => 'single',
        'path' => storage_path('logs/laravel.log'),
        'level' => 'debug',
        'tap' => [\EUR\RSM\LaravelLogging\Tap\ConfiguredProcessororsTap::class],
    ],
    // ...
];

Using the ECS Formatter

To use the ECS formatter simply override the formatter in config/logging.php.

return [
    // ...
    'single' => [
        'driver' => 'single',
        'path' => storage_path('logs/laravel.log'),
        'level' => 'debug',
        'formatter' => \EUR\RSM\LaravelLogging\Formatter\ElasticCommonSchemaFormatter::class,
    ],
    // ...
];

[Optional] Override config

Publish the config via php artisan vendor:publish and configure the processers to your liking.

About

Enrich laravel loging with context information

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages