catchamonkey/console-logger-bundle
Artisan console system, not Symfony’s Console component.monolog/monolog. However, the integration would require custom bridging logic.handle() in ExceptionHandler).Console event listeners to Laravel’s Artisan command lifecycle.Artisan::call() and handle() methods. Custom logging can be achieved with Laravel’s event system (CommandFinished, CommandFailed) or middleware.Artisan events or middleware.CommandFailed listener) is more sustainable.Artisan commands use Illuminate\Console\Command, not Symfony’s Symfony\Component\Console\Command.CommandFinished, CommandFailed) to log exceptions.
// In a service provider
Artisan::extend(function ($artisan) {
$artisan->resolving(Command::class, function ($command) {
$command->after(function ($output) use ($command) {
if ($command->hasError()) {
Log::error('Command failed', [
'command' => $command->getName(),
'error' => $command->errorOutput(),
]);
}
});
});
});
Artisan command error handling (e.g., try-catch blocks).Artisan::call() with error callbacks or Command events.CommandLogger trait).spatie/laravel-log-viewer).Log facade.Console component will need to reverse-engineer the bundle’s logic.Artisan events are well-documented; ramp-up time is ~1–2 days for a custom solution.Command lifecycle.How can I help you explore Laravel packages today?