๐Ÿ“‚ File Browser

AgentAI/vendor/monolog/monolog/src/Monolog/Handler
๐ŸŒ™ Dark Mode
๐ŸŽฏ Quick Launch:

๐Ÿ“ Directories

๐Ÿ“ Curl/ ๐Ÿ”“ Open
๐Ÿ“ FingersCrossed/ ๐Ÿ”“ Open
๐Ÿ“ Slack/ ๐Ÿ”“ Open
๐Ÿ“ SyslogUdp/ ๐Ÿ”“ Open

๐Ÿ“„ Files

๐Ÿ˜ AbstractHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ AbstractProcessingHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ AbstractSyslogHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ AmqpHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ BrowserConsoleHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ BufferHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ChromePHPHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ CouchDBHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ CubeHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ DeduplicationHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ DoctrineCouchDBHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ DynamoDbHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ElasticaHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ElasticsearchHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ErrorLogHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FallbackGroupHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FilterHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FingersCrossedHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FirePHPHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FleepHookHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FlowdockHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FormattableHandlerInterface.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ FormattableHandlerTrait.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ GelfHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ GroupHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ Handler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ HandlerInterface.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ HandlerWrapper.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ IFTTTHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ InsightOpsHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ LogEntriesHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ LogglyHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ LogmaticHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ MailHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ MandrillHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ MissingExtensionException.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ MongoDBHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ NativeMailerHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ NewRelicHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ NoopHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ NullHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ OverflowHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ PHPConsoleHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ProcessHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ProcessableHandlerInterface.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ProcessableHandlerTrait.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ PsrHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ PushoverHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ RedisHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ RedisPubSubHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ RollbarHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ RotatingFileHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SamplingHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SendGridHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SlackHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SlackWebhookHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SocketHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SqsHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ StreamHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SymfonyMailerHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SyslogHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ SyslogUdpHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ TelegramBotHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ TestHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ WebRequestRecognizerTrait.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ WhatFailureGroupHandler.php
โ–ถ Open ๐Ÿ“„ View Source
๐Ÿ˜ ZendMonitorHandler.php
โ–ถ Open ๐Ÿ“„ View Source

๐Ÿ“„ Source: GroupHandler.php

<?php declare(strict_types=1);

/*
 * This file is part of the Monolog package.
 *
 * (c) Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Monolog\Handler;

use Monolog\Formatter\FormatterInterface;
use Monolog\ResettableInterface;
use Monolog\LogRecord;

/**
 * Forwards records to multiple handlers
 *
 * @author Lenar Lรตhmus <lenar@city.ee>
 */
class GroupHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface
{
    use ProcessableHandlerTrait;

    /** @var HandlerInterface[] */
    protected array $handlers;
    protected bool $bubble;

    /**
     * @param HandlerInterface[] $handlers Array of Handlers.
     * @param bool               $bubble   Whether the messages that are handled can bubble up the stack or not
     *
     * @throws \InvalidArgumentException if an unsupported handler is set
     */
    public function __construct(array $handlers, bool $bubble = true)
    {
        foreach ($handlers as $handler) {
            if (!$handler instanceof HandlerInterface) {
                throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.');
            }
        }

        $this->handlers = $handlers;
        $this->bubble = $bubble;
    }

    /**
     * @inheritDoc
     */
    public function isHandling(LogRecord $record): bool
    {
        foreach ($this->handlers as $handler) {
            if ($handler->isHandling($record)) {
                return true;
            }
        }

        return false;
    }

    /**
     * @inheritDoc
     */
    public function handle(LogRecord $record): bool
    {
        if (\count($this->processors) > 0) {
            $record = $this->processRecord($record);
        }

        foreach ($this->handlers as $handler) {
            $handler->handle(clone $record);
        }

        return false === $this->bubble;
    }

    /**
     * @inheritDoc
     */
    public function handleBatch(array $records): void
    {
        if (\count($this->processors) > 0) {
            $processed = [];
            foreach ($records as $record) {
                $processed[] = $this->processRecord($record);
            }
            $records = $processed;
        }

        foreach ($this->handlers as $handler) {
            $handler->handleBatch(array_map(fn ($record) => clone $record, $records));
        }
    }

    public function reset(): void
    {
        $this->resetProcessors();

        foreach ($this->handlers as $handler) {
            if ($handler instanceof ResettableInterface) {
                $handler->reset();
            }
        }
    }

    public function close(): void
    {
        parent::close();

        foreach ($this->handlers as $handler) {
            $handler->close();
        }
    }

    /**
     * @inheritDoc
     */
    public function setFormatter(FormatterInterface $formatter): HandlerInterface
    {
        foreach ($this->handlers as $handler) {
            if ($handler instanceof FormattableHandlerInterface) {
                $handler->setFormatter($formatter);
            }
        }

        return $this;
    }
}
โ† Back