Built for those poor souls (ie. myself) that are stuck professionally with Laravel for the foreseeable future.
https://github.com/dev-this/laravel-console-logg
Zero dependency, no magic (ie. traits/magic methods/static calls), Logger output for your console commands. Leaves your usual application logging channels/drivers untouched.
tl;dr: With your console/’artisan‘ commands, Laravel logger/PSR-3 output will output to your shell.
Considering Laravel’s command and web kernels both literally extend (and worsens?) Symfony components, I was (not really cause it’s Laravel) surprised to find that it was not a simple task to setup Symfony Console Logger without violating your own principles.
Stackoverflow answerers try to convince you the only way is to write console-output specific code for your shared services, or change your default logging driver – both of which are not really great solutions (depending on your circumstances).
Please r8 my code + implementation + repo, I’m always open to feedback and (constructive preferred) criticism – haven’t really released a package/repo before.
no comments yet
Be the first to share what you think!
Members
Online