I recently started working on a Laravel 5 project, and I’d like to share how I set up my custom file logging. I pooled the information below from several sources (acknowledged at the bottom of the article).
He walks through each step you'll need to configure the logging:
- Overriding the bootstrap ConfigureLogging class (including the code needed)
- Updating your composer.json to change up the PSR-4 autoloading
- Modifying the Kernel.php file to update the constructor for the bootstrap (both HTTP and Console)
With these changes in place you can then use the normal "Log" handling Laravel provides and the magic will all happen behind the scenes. He includes two examples of this, one with a simple log string and another with something a bit more complex (and the resulting log output).