Advanced Monolog Channel Customization: Customizing Monolog For Channels

'single' => [
    'driver' => 'single',
    'tap' => [App\Logging\CustomizeFormatter::class],
    'path' => storage_path('logs/laravel.log'),
    'level' => 'debug',
],
<?php

namespace App\Logging;

class CustomizeFormatter
{
    /**
     * Customize the given logger instance.
     *
     * @param  \Illuminate\Log\Logger  $logger
     * @return void
     */
    public function __invoke($logger)
    {
        foreach ($logger->getHandlers() as $handler) {
            $handler->setFormatter(...);
        }
    }
}

Advanced Monolog Channel Customization: Customizing Monolog For Channels — Structure map

Clickable & Draggable!

Advanced Monolog Channel Customization: Customizing Monolog For Channels — Related pages: