yii\log\Dispatcher::dispatch PHP Méthode

dispatch() public méthode

Dispatches the logged messages to [[targets]].
public dispatch ( array $messages, boolean $final )
$messages array the logged messages
$final boolean whether this method is called at the end of the current application
    public function dispatch($messages, $final)
    {
        $targetErrors = [];
        foreach ($this->targets as $target) {
            if ($target->enabled) {
                try {
                    $target->collect($messages, $final);
                } catch (\Exception $e) {
                    $target->enabled = false;
                    $targetErrors[] = ['Unable to send log via ' . get_class($target) . ': ' . ErrorHandler::convertExceptionToString($e), Logger::LEVEL_WARNING, __METHOD__, microtime(true), []];
                }
            }
        }
        if (!empty($targetErrors)) {
            $this->dispatch($targetErrors, true);
        }
    }