SecurityCore, HttpFoundation) introduces misalignment. The deprecation fixes in v7.1.0 suggest the bundle is trimming Symfony-specific cruft, but Laravel’s Monolog v2.x may still face edge cases.user_id, request_id, client_ip) without manual log formatting. The bundle’s MIT license and Symfony 6.x compatibility reduce risk for modern stacks.ExtraContextProcessor) are likely reusable in Laravel, but:
composer why symfony/security-core).// config/logging.php
'processors' => [
\Deamon\LoggerExtraBundle\Processor\ExtraContextProcessor::class,
],
composer require monolog/monolog:^2.0 --dev
composer why symfony post-installation.laravel-debugbar or blackfire.io.symfony/* dependencies in the bundle’s composer.json or autoload?ExtraContextProcessor extend a Symfony class?addRecord() or processRecord() signatures?user_id) via config or service binding?LogContext facade)?Log::withContext(['user_id' => auth()->id()])->info('Event');
// app/Providers/AppServiceProvider.php
use Deamon\LoggerExtraBundle\Processor\ExtraContextProcessor;
public function boot()
{
\Log::tap(function ($monolog) {
$monolog->pushProcessor(new ExtraContextProcessor());
});
}
Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface errors.config/logging.php:
'processors' => [
\Deamon\LoggerExtraBundle\Processor\ExtraContextProcessor::class,
],
user_class) via service binding:
$this->app->bind(\Deamon\LoggerExtraBundle\Processor\ExtraContextProcessor::class, function ($app) {
return new ExtraContextProcessor([
'user_class' => \App\Models\User::class,
'user_methods' => ['getId' => 'id'],
]);
});
composer require deamon/logger-extra-bundle --dev
composer remove symfony/security-bundle symfony/http-foundation
AppServiceProvider (as above).\Log::info('Test', ['custom' => 'data']);
Expected output: Log includes extra.request_id, extra.user_id, etc.config/logging.php or a custom config file.// config/deamon_logger.php
return [
'handlers' => ['single'], // Laravel's default handler
'display' => [
'env' => env('APP_DEBUG'),
'user' => true,
],
];
processRecord() method compatibility.addRecord()).composer why symfony to audit dependencies.extra.request_id).spatie/laravel-logging.7.1.0).ExtraContextProcessor.composer why symfony to diagnose residual dependencies.single vs. daily).Log::withoutOverhead() for bulk operations.spatie/laravel-logging or custom solutions.Monolog\Handler\StreamHandler with gzip).Monolog\Handler\FilterHandler).| Failure | Impact | Mitigation |
|---|---|---|
| Symfony dependency errors | Logs fail to process | Fork the bundle; remove Symfony classes. |
| Monolog version mismatch | Processor crashes | Pin Monolog to v2.x; test with v3.x. |
| Context injection overhead | High latency in logging | Disable for non-critical handlers. |
| Bundle abandonment | No future updates | Fork and maintain Laravel-specific version. |
README.md for the forked version.// config/logging.php
'processors' => [
\Vendor\LoggerExtraBundle\Processor\LaravelExtraContextProcessor::class,
],
AppServiceProvider.How can I help you explore Laravel packages today?