eur-rsm / laravel-logging
Enrich laravel logging
Installs: 4 827
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:laravel-library
pkg:composer/eur-rsm/laravel-logging
Requires
- php: >=8.1
- illuminate/auth: ^10.0 || ^11.0 || ^12.0
- illuminate/log: ^10.0 || ^11.0 || ^12.0
- monolog/monolog: ^3.0
README
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.